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

Re: [PATCH 1/2] xdiff: implement a zealous diff3, or "zdiff3"

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 15, 2021, 06:13 UTC
Message-ID
<xmqqv96fven9.fsf@gitster.g>
In-Reply-To
<b7561a67c192d4bdede47fee5b7b1cb30c44b785.1623734171.git.gitgitgadget@gmail.com>
"Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com> writes:
[An example to reduce
    1234<ABCDE|56=AXCYE>789
to
    1234A<BCD|56=XCY>E789
elided]
Show 6 quoted lines
> Note that the common lines, 'A', and 'E' were moved outside the
> conflict.  Unlike with the two-way conflicts from the 'merge'
> conflictStyle, the zdiff3 conflict is NOT split into multiple conflict
> regions to allow the common 'C' lines to be shown outside a conflict,
> because zdiff3 shows the base version too and the base version cannot be
> reasonably split.

Another thing that was brought up during the original discussion is that zdiff3 uses different meaning of "base version" from diff3. In diff3 output, if you remove everything enclosed in <<< and |||, and everything enclosed in === and >>>, i.e. 123456789 in the original example above, you will get "the common ancestor" version, which is what is shown as the "base". After zdiff3 munges the lines, that is not the case, 1234A56E789 never appeared in anybody's version. It is a "starting from the common ancestor version, both sides agreed to make the same uncontroversial changes, which is already included in this base version" and zdiff3 inserts the conflict markers and material unique to each side into it. Being able to recover the common ancestor version is not always necessary and that is what makes zdiff3 a plausible solution, but to some workflows and tools it may matter, so it would be helpful to mention it in the documentation.

Thanks.
Previous: Elijah Newren via GitGitGadgetNext: Felipe Contreras
Message 3 of 39 in “RFC: implement new zdiff3 conflict style”
  1. 0/2 RFC: implement new zdiff3 conflict styleElijah Newren via GitGitGadget, Jun 15, 2021
  2. 1/2 xdiff: implement a zealous diff3, or "zdiff3"Elijah Newren via GitGitGadget, Jun 15, 2021
  3. Junio C HamanoJun 15, 2021
  4. Felipe ContrerasJun 15, 2021
  5. Elijah NewrenJun 15, 2021
  6. Sergey OrganovJun 15, 2021
  7. 2/2 update documentation for new zdiff3 conflictStyleElijah Newren via GitGitGadget, Jun 15, 2021
  8. Junio C HamanoJun 15, 2021
  9. Jeff KingJun 15, 2021
  10. Elijah NewrenJun 15, 2021
  11. Phillip WoodJun 16, 2021
  12. Jeff KingJun 16, 2021
  13. Phillip WoodJun 23, 2021
  14. Jeff KingJun 23, 2021
  15. Elijah NewrenJun 17, 2021
  16. Johannes SixtJun 15, 2021
  17. Elijah NewrenJun 15, 2021
  18. Johannes SixtJun 16, 2021
  19. Elijah NewrenJun 16, 2021
  20. 0/2 RFC: implement new zdiff3 conflict styleElijah Newren via GitGitGadget, Sep 11, 2021
  21. 1/2 xdiff: implement a zealous diff3, or "zdiff3"Elijah Newren via GitGitGadget, Sep 11, 2021
  22. Phillip WoodSep 15, 2021
  23. Phillip WoodSep 15, 2021
  24. Elijah NewrenSep 18, 2021
  25. Phillip WoodSep 24, 2021
  26. Elijah NewrenSep 18, 2021
  27. Phillip WoodSep 24, 2021
  28. 2/2 update documentation for new zdiff3 conflictStyleElijah Newren via GitGitGadget, Sep 11, 2021
  29. 0/2 RFC: implement new zdiff3 conflict styleElijah Newren via GitGitGadget, Sep 18, 2021
  30. 1/2 xdiff: implement a zealous diff3, or "zdiff3"Elijah Newren via GitGitGadget, Sep 18, 2021
  31. 2/2 update documentation for new zdiff3 conflictStyleElijah Newren via GitGitGadget, Sep 18, 2021
  32. 0/2 Implement new zdiff3 conflict styleElijah Newren via GitGitGadget, Nov 16, 2021
  33. 1/2 xdiff: implement a zealous diff3, or "zdiff3"Phillip Wood via GitGitGadget, Nov 16, 2021
  34. 2/2 update documentation for new zdiff3 conflictStyleElijah Newren via GitGitGadget, Nov 16, 2021
  35. 0/2 Implement new zdiff3 conflict styleElijah Newren via GitGitGadget, Dec 1, 2021
  36. 1/2 xdiff: implement a zealous diff3, or "zdiff3"Phillip Wood via GitGitGadget, Dec 1, 2021
  37. 2/2 update documentation for new zdiff3 conflictStyleElijah Newren via GitGitGadget, Dec 1, 2021
  38. Bagas SanjayaDec 2, 2021
  39. Eric SunshineDec 2, 2021

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.