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
ZEALOUSBut 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