git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/7] [doc] Add new gitmergeconflicts man page

From
Patrick Steinhardt <ps@pks.im>
Date
Oct 1, 2026, 05:14 UTC
Message-ID
<ar3sGzEknG2_Un_E@pks.im>
In-Reply-To
<xmqqqzia8ohv.fsf@gitster.g>
On Wed, Sep 30, 2026 at 01:37:16PM -0700, Junio C Hamano wrote:
Show 31 quoted lines
> "Julia Evans" <julia@jvns.ca> writes:
> 
> >>> +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.

Yup. Doesn't mean we cannot _also_ include the names that we have above. So in the above example it could be for example:

+FRUITS = [
+    "apple",
+<<<<<<< HEAD: abcdefg (fruits: add apple, 2026-10-01)
+    "cherry",
+=======
+    "banana",
+>>>>>>> add-fruit: 12345678 (fruits: add banana, 2024-02-03)
That format would have a bunch of advantages:
  - We don't have to teach users about special refs like MERGE_HEAD to
    let them figure out how to access each of the commits.
  - It gives a bit more context about what each specific side does, at
    least if you have good commit messages.
  - It also gives a sense of timing because we include dates, and that
    may help in some situations to figure out what's what.

I'll create an issue on the GitLab side and ask someone in the team to maybe give this a try.

Show 13 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.
I very much agree that it should be the default.
Patrick
Previous: Junio C HamanoNext: Julia Evans
Message 8 of 65 in “[doc] Add new page on merge conflicts”
  1. 0/7 [doc] Add new page on merge conflictsJulia Evans via GitGitGadget, Sep 24, 2026
  2. 1/7 [doc] Add new gitmergeconflicts man pageJulia Evans via GitGitGadget, Sep 24, 2026
  3. Junio C HamanoSep 24, 2026
  4. Junio C HamanoSep 24, 2026
  5. Patrick SteinhardtSep 30, 2026
  6. Julia EvansSep 30, 2026
  7. Junio C HamanoSep 30, 2026
  8. Patrick SteinhardtOct 1, 2026
  9. Julia EvansOct 1, 2026
  10. Junio C HamanoOct 2, 2026
  11. Julia EvansOct 5, 2026
  12. Junio C HamanoOct 5, 2026
  13. Julia EvansOct 5, 2026
  14. 2/7 [doc] git-merge: link to new merge conflicts guideJulia Evans via GitGitGadget, Sep 24, 2026
  15. D. Ben KnobleSep 25, 2026
  16. Julia EvansSep 25, 2026
  17. Junio C HamanoSep 25, 2026
  18. Ben KnobleSep 25, 2026
  19. Junio C HamanoSep 25, 2026
  20. Ben KnobleSep 25, 2026
  21. Julia EvansOct 2, 2026
  22. Junio C HamanoOct 2, 2026
  23. Julia EvansOct 2, 2026
  24. Junio C HamanoOct 2, 2026
  25. D. Ben KnobleOct 3, 2026
  26. Junio C HamanoOct 3, 2026
  27. Patrick SteinhardtSep 30, 2026
  28. 3/7 [doc] git-rebase: link to new merge conflicts guideJulia Evans via GitGitGadget, Sep 24, 2026
  29. 4/7 [doc] git-revert: link to new merge conflicts guideJulia Evans via GitGitGadget, Sep 24, 2026
  30. 5/7 [doc] git-cherry-pick: link to new merge conflicts guideJulia Evans via GitGitGadget, Sep 24, 2026
  31. Junio C HamanoSep 25, 2026
  32. Julia EvansSep 28, 2026
  33. Junio C HamanoSep 28, 2026
  34. 6/7 [doc] git-pull: link to new merge conflicts guideJulia Evans via GitGitGadget, Sep 24, 2026
  35. 7/7 [doc] ignore conflict markers in gitmergeconflicts.adocJulia Evans via GitGitGadget, Sep 24, 2026
  36. Junio C HamanoOct 7, 2026
  37. Julia EvansOct 9, 2026
  38. Junio C HamanoSep 24, 2026
  39. Jeff KingSep 24, 2026
  40. Julia EvansSep 28, 2026
  41. Jeff KingSep 29, 2026
  42. Junio C HamanoSep 29, 2026
  43. D. Ben KnobleSep 25, 2026
  44. Julia EvansOct 2, 2026
  45. D. Ben KnobleOct 3, 2026
  46. Julia EvansOct 5, 2026
  47. D. Ben KnobleOct 6, 2026
  48. D. Ben KnobleOct 6, 2026
  49. 0/6 [doc] Add new page on merge conflictsJulia Evans via GitGitGadget, Oct 9, 2026
  50. 1/6 doc: add new gitmergeconflicts man pageJulia Evans via GitGitGadget, Oct 9, 2026
  51. Junio C HamanoOct 9, 2026
  52. Julia EvansOct 9, 2026
  53. 2/6 doc: git-merge: link to new merge conflicts guideJulia Evans via GitGitGadget, Oct 9, 2026
  54. Junio C HamanoOct 9, 2026
  55. 3/6 doc: git-rebase: link to new merge conflicts guideJulia Evans via GitGitGadget, Oct 9, 2026
  56. Junio C HamanoOct 9, 2026
  57. 4/6 doc: git-revert: link to new merge conflicts guideJulia Evans via GitGitGadget, Oct 9, 2026
  58. Junio C HamanoOct 9, 2026
  59. 5/6 doc: git-cherry-pick: link to new merge conflicts guideJulia Evans via GitGitGadget, Oct 9, 2026
  60. Junio C HamanoOct 9, 2026
  61. 6/6 doc: git-pull: link to new merge conflicts guideJulia Evans via GitGitGadget, Oct 9, 2026
  62. Junio C HamanoOct 9, 2026
  63. Junio C HamanoOct 9, 2026
  64. Julia EvansOct 9, 2026
  65. Junio C HamanoOct 9, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.