Re: [PATCH 1/7] [doc] Add new gitmergeconflicts man page
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 30, 2026, 20:37 UTC
- Message-ID
- <xmqqqzia8ohv.fsf@gitster.g>
- In-Reply-To
- <5ba2088c-4919-465f-8892-4ed0685f81ea@app.fastmail.com>
"Julia Evans" <julia@jvns.ca> writes:
Show 21 quoted lines
>>> +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-fruit >> Hide 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.
Show 7 quoted lines
>> 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.