[BUG] "git merge-file" mismerge
From: Junio C Hamano <hidden>
Date: 2016-06-15 23:02:00
Consider these three files:
$ printf "%s\n" A B C D >ours
$ printf "%s\n" A C B D >common
$ printf "%s\n" A B D >theirs
Starting from A C B D, our side flips the order of the second (C)
and the third (B), while their side removes the second (C).
The correct three-way content level merge should notice conflict
during this merge, but "git merge-file" that uses xdiff/xmerge.c,
which is meant to be equivalent to "merge" from the RCS suite,
declares that our version is already the correct merge result:
$ merge ours common theirs
merge: warning: conflicts during merge
$ cat ours
A
<<<<<<< ours
B
C
=======
B
>>>>>>> theirs
D
$ printf "%s\n" A B C D >ours ;# revert it back
$ git merge-file ours common theirs ; echo $?
0
$ cat ours
A
B
C
D