1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-06 17:23:00 +01:00
git/xdiff
Johannes Schindelin 22b6abcd08 Fix yet another subtle xdl_merge() bug
In very obscure cases, a merge can hit an unexpected code path (where the
original code went as far as saying that this was a bug). This failing
merge was noticed by Alexandre Juillard.

The problem is that the original file contains something like this:

-- snip --
two non-empty lines
before two empty lines

after two empty lines
-- snap --

and this snippet is reduced to _one_ empty line in _both_ new files.
However, it is ambiguous as to which hunk takes the empty line: the first
or the second one?

Indeed in Alexandre's example files, the xdiff algorithm attributes the
empty line to the first hunk in one case, and to the second hunk in the
other case.

(Trimming down the example files _changes_ that behaviour!)

Thus, the call to xdl_merge_cmp_lines() has no chance to realize that the
change is actually identical in both new files. Therefore,
xdl_refine_conflicts() finds an empty diff script, which was not expected
there, because (the original author of xdl_merge() thought)
xdl_merge_cmp_lines() would catch that case earlier.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-30 18:05:05 -08:00
..
xdiff.h xdiff: add xdl_merge() 2006-12-02 17:28:19 -08:00
xdiffi.c xdiff: add xdl_merge() 2006-12-02 17:28:19 -08:00
xdiffi.h xdiff: add xdl_merge() 2006-12-02 17:28:19 -08:00
xemit.c Increase length of function name buffer 2006-11-23 22:51:41 -08:00
xemit.h Use a *real* built-in diff generator 2006-03-25 16:49:58 -08:00
xinclude.h xdiff: Show function names in hunk headers. 2006-03-27 18:43:51 -08:00
xmacros.h Fix hash function in xdiff library 2006-10-16 21:27:44 -07:00
xmerge.c Fix yet another subtle xdl_merge() bug 2006-12-30 18:05:05 -08:00
xprepare.c Teach diff about -b and -w flags 2006-06-23 17:35:27 -07:00
xprepare.h Use a *real* built-in diff generator 2006-03-25 16:49:58 -08:00
xtypes.h Use a *real* built-in diff generator 2006-03-25 16:49:58 -08:00
xutils.c diff -b: ignore whitespace at end of line 2006-12-04 16:30:54 -08:00
xutils.h Teach diff about -b and -w flags 2006-06-23 17:35:27 -07:00