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

Re: [PATCH] xdiff: implement a zealous diff3

From
Jeff King <peff@peff.net>
Date
Mar 6, 2013, 20:46 UTC
Message-ID
<20130306204612.GA24535@sigill.intra.peff.net>
In-Reply-To
<1362602202-29749-1-git-send-email-u.kleine-koenig@pengutronix.de>
On Wed, Mar 06, 2013 at 09:36:42PM +0100, Uwe Kleine-König wrote:
Show 6 quoted lines
> "zdiff3" is identical to ordinary diff3, only it allows more aggressive
> compaction than diff3. This way the displayed base isn't necessary
> technically correct, but still this mode might help resolving merge
> conflicts between two near identical additions.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
I think the patch is correct, assuming this is the interface we want.
It would be more flexible instead to have:
  1. user can configure zealous-level of merge via command-line or
     config (they cannot control it at all right now)
  2. when diff3 is used and no level is explicitly given, do not go
     above EAGER
  3. otherwise, respect the level given by the user, even if it is
     ZEALOUS

But that would involve a lot of refactoring. I don't know if it is worth the effort (the bonus is that people can then set the level independently, but I do not know that anyone ever wants to do that).

Show 6 quoted lines
>  builtin/merge-file.c                   | 2 ++
>  contrib/completion/git-completion.bash | 2 +-
>  xdiff-interface.c                      | 2 ++
>  xdiff/xdiff.h                          | 1 +
>  xdiff/xmerge.c                         | 8 +++++++-
>  5 files changed, 13 insertions(+), 2 deletions(-)

I think this would need documentation not only to let users know about the feature, but also to warn them of the caveats.

-Peff
Previous: Uwe Kleine-KönigNext: Junio C Hamano
Message 6 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.