3 ms·
The problem with 3-way merge (when it comes to rebasing and merging at least) is that you lose all the information about why "theirs" changed. You made a modif
by IshKebab 4y ago
The problem with 3-way merge (when it comes to rebasing and merging at least) is that you lose all the information about why "theirs" changed.
You made a modification to the code. They made a conflicting modification. You want to know what they hell they were doing so you know how to rejig your edit. The normal tool to use here would be `git blame` but that just doesn't work. At least in any tool I have used.
If anyone knows of one where it does work I'd love to know!
- js2 4y agoWhen I'm confused by a 3-way diff (I personally prefer FileMerge/opendiff on macOS) and need more info I like to use git log to examine the relevant commits using the "..." operator which returns the symmetric difference between two commits (in this case both sides of the merge) and their merge base: git log -p HEAD...MERGE_HEAD --path/to/file https://www.git-scm.com/docs/git-log https://www.git-scm.com/docs/git-log Another trick is doing multiple merges which each include fewer commits. Sometimes the problem is that you're just trying to merge too much at a time. The downside of this is that in files with a lot of churn you may have to deal with conflicts that you might otherwise not. So it's a bit of a two-edged sword.
- mambru 4y agoIIRC vscode with gitlens extension shows blame on hover, also for the conflicting lines.
- Gehinnn 4y agoThe new 3 way merge editor in VS Code tries to load the documents for base, yours and theirs from the corresponding commit URI, so that extensions such as gitlens can show the line history for each document - they don't even have to know about the merge editor. (disclaimer - I work on VS Code and its 3 way merge editor)
- magicalhippo 4y ago> for base, yours and theirs I really hate that relative terminology. Call them "working copy", "merging commit" and "common ancestor" or something similarly absolute. And give me the revision/commit id's for each, so it's crystal clear in case I want to check up manually. Not a dig on the vscode extension, but 3-way diff tools in general.
- IshKebab 4y agoYeah I 100% agree. Especially as Git gets it backwards in some cases! It's not even consistent about the names. Sometime I see "current" and "incoming" which is not really any better. > And give me the revision/commit id's for each It could show the branch names! `change on master`, `change on myfeature` or whatever.
- Gehinnn 4y agoThe 3 way merge editor actually shows the branch name!
- IshKebab 4y agoMaybe I'll give it another got but to be honest I found the new merge editor even more confusing than just reading zdiff3. Sorry!
- IshKebab 4y agoThat's what I'm using. Unfortunately it doesn't. :-/