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

Re: feature suggestion: optimize common parts for checkout --conflict=diff3

From
Jeff King <peff@peff.net>
Date
Mar 7, 2013, 08:04 UTC
Message-ID
<20130307080411.GA25506@sigill.intra.peff.net>
In-Reply-To
<7vmwugp637.fsf@alter.siamese.dyndns.org>
On Wed, Mar 06, 2013 at 01:32:28PM -0800, Junio C Hamano wrote:
Show 13 quoted lines
> > We show "both sides added, either identically or differently" as
> > noteworthy events, but the patched code pushes "both sides added
> > identically" case outside the conflicting hunk, as if what was added
> > relative to the common ancestor version (in Uwe's case, is it 1-14
> > that is common, or just 10-14?) is not worth looking at when
> > considering what the right resolution is.  If it is not worth
> > looking at what was in the original for the conflicting part, why
> > would we be even using diff3 mode in the first place?
> 
> I vaguely recall we did this "clip to eager" as an explicit bugfix
> at 83133740d9c8 (xmerge.c: "diff3 -m" style clips merge reduction
> level to EAGER or less, 2008-08-29).  The list archive around that
> time may give us more contexts.
Thanks for the pointer. The relevant threads are:
  http://article.gmane.org/gmane.comp.version-control.git/94228
and
  http://thread.gmane.org/gmane.comp.version-control.git/94339

There is not much discussion beyond what ended up in 8313374; both Linus and Dscho question whether level and output format are orthogonal, but seem to accept the explanation you give in the commit message.

Having read that commit and the surrounding thread, I think I stand by my argument that "zdiff3" is a useful tool to have, as long as the user understands what the hunks mean. It should never replace diff3, but I think it makes sense as a separate format.

I was also curious whether it would the diff3/zealous combination would trigger any weird corner cases. In particular, I wanted to know how the example you gave in that commit of:

  postimage#1: 1234ABCDE789
                  |    /
                  |   /
  preimage:    123456789
                  |   \
                  |    \
  postimage#2: 1234AXCYE789

would react with diff3 (this is not the original example, but one with an extra "C" in the middle of postimage#2, which could in theory be presented as split hunks). However, it seems that we do not do such hunk splitting at all, neither for diff3 nor for the "merge" representation.

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 15 of 24 in “feature suggestion: optimize common parts for checkout --conflict=diff3”
  1. Uwe Kleine-KönigMar 6, 2013
  2. Antoine PelisseMar 6, 2013
  3. Antoine PelisseMar 6, 2013
  4. Jeff KingMar 6, 2013
  5. xdiff: implement a zealous diff3Uwe Kleine-König, Mar 6, 2013
  6. Jeff KingMar 6, 2013
  7. Junio C HamanoMar 6, 2013
  8. Jeff KingMar 6, 2013
  9. Junio C HamanoMar 6, 2013
  10. Jeff KingMar 6, 2013
  11. Junio C HamanoMar 6, 2013
  12. Jeff KingMar 7, 2013
  13. Uwe Kleine-KönigMar 6, 2013
  14. Junio C HamanoMar 6, 2013
  15. Jeff KingMar 7, 2013
  16. Junio C HamanoMar 7, 2013
  17. Jeff KingMar 7, 2013
  18. Junio C HamanoMar 7, 2013
  19. Jeff KingMar 7, 2013
  20. Jeff KingApr 4, 2013
  21. Uwe Kleine-KönigApr 4, 2013
  22. Jeff KingApr 4, 2013
  23. Junio C HamanoApr 4, 2013
  24. Junio C HamanoMar 7, 2013

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.