threads / bug / 37188

[BUG] "git merge-file" mismerge

Subject: [BUG] "git merge-file" mismerge

## tl;dr

One message between Jul 22, 2014 and Jul 22, 2014.

replies: 0people: 1as markdown or json

Junio C Hamano· Jul 22, 2014, 19:19 UTC · lore
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
    
    

← back to recent threads