On a related note, I seriously recommend everyone to set their merge.conflictStyle to diff3 (or even zdiff3 on newer Gits). It shows you all of your version, thier version, and the original, common-ancestor version. It really should be the default, and, as far as I know, the only reason it isn't is because there are some older diff(1) implementation that don't support three-way diffs.
I think learning diff3 has had one of the largest ROIs of anything I've perhaps _ever_ learned. I show it to interns whenever I can, which tends to remind me just how daunting it is to use for the first time.
What do you use them for? I went through the GitLab doc, I see how it could make sense for automated PRs, but for manual ones I don't see how I would benefit from them.
You can also just type “git mergetool” and it will open up your difftool of choice with all 4 versions of the file on one screen. Assuming you have a difftool capable of 3-way merge.
Manually reading through merge conflict markers feels very old once you get used to this.
It can display merge conflicts (as Git can display those) but it doesn't resolve them. It's purely a display tool. Its installation instructions recommend setting `merge.conflictstyle = diff3` but that's not an automatic process.
When I'm merging, and things are really messed up due to unrelated things being diffed together, in a situation in which both must survive in the merged result, I do this:
1. Find syntactic boundaries before and after the conflict, in order to delimit an area that is a complete piece of top-level syntax, in which the conflict lies. So that is to say if the conflict is flanked by fragments of syntax, I include them.
2. I make a copy of this entire area, so that I have two consecutive copies of the complete syntactic unit, and therefore two copies of the conflict.
3. Go through the first copy and edit it with a view toward one side of the conflict.
4. Repeat on the second copy, but with a view toward keeping the changes from the other side of the conflict.
WTF? Ah, OK: there is originally a foo(), and one side added bar() and the other xyzzy(). We need both. Ah, and foo was tweaked t o be different.
OK, what is the complete syntactic unit? We include everything from the "static void foo" to the closing brace after the >>>>>> and copy it. We include markers:
The "More flexible fsync configuration" section made me think of [1]. I wonder how much faster Git would get by using Sqlite to manage the DB instead of using naked filesystem objects.
Anyone know of up-to-date binaries for Mac OS ... our work machines are heavily restricted, we can not compile from sources, use homebrew, install into /usr/local, etc.
I just want something I can put in ~/.local/bin or something, like so many modern command line tools these days (fzf, rg, etc).
git-osx-installer doesn't seem to be maintained. It still seems strange to me that in 2021 such a large project doesn't have official binaries for a popular platform.
Regarding fetch --refetch. Why does it need to refetch all the objects and not just the missing ones? And in that case, is it not possible for such recovery to be automatic without extra flags?
Very often with these failures it’s really just a single tree-object that is missing.
See https://blog.nilbus.com/take-the-pain-out-of-git-conflict-re... and https://stackoverflow.com/q/27417656.