Re: [PATCH 1/7] [doc] Add new gitmergeconflicts man page
From: Junio C Hamano <hidden>
Date: 2026-09-30 20:37:18
"Julia Evans" [off-list ref] writes:
quoted
quoted
+to include merge conflict markers `<<<<<<<`, `=======`, and `>>>>>>>`. +For example, here's a merge conflict where both sides edited a list of +fruits in different ways: + +---- +FRUITS = [ + "apple", +<<<<<<< HEAD + "cherry", +======= + "banana", +>>>>>>> add-fruitHide quoted text A bit of a tangent, but sometimes I wonder whether we should make the respective commits a bit easier to access. For example, we could put the equivalent of `git rev-parse --reference <commit>` here for each of the sides.Personally I'm not sure if the commit ID would do much for me, but I feel like it would help me if it were possible to include the commit message.
It would also help the resolution, not just committing after you are done. It may not matter while picking between cherry and banana to show your personal preference on fruits, but in a more involved conflicted merge, it may help to be able to view "git show $commit", "git diff ...$commit", and "git diff $commit..." where $commit is the "add-fruit" side of the merge to understand what they wanted to do, and what we have done while they weren't looking.
quoted
I tend to forget that by default, we only render ours/theirs in the conflict. I always feel like that makes it way harder to resolve conflicts as you don't have the context of what the code looked like originally. So I have diff3 configured locally for ages.Every time I show people diff3 someone tells me how happy they are to learn it :)
Yes, we should encourage "merge.conflictstyle=diff3" (I feel about this strongly enough to think it should become the default). Knowing what the original was before one side wanted to say "cherry" while the other side wanted to say "banana" sometimes helps a great deal to decide what to do with the conflict.