{"thread":{"id":"37188","subject":"[BUG] \"git merge-file\" mismerge","startedAt":"2014-07-22T19:19:21Z","lastAt":"2014-07-22T19:19:21Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"246515","messageId":"xmqqzjg1fbgm.fsf@gitster.dls.corp.google.com","threadId":"37188","inReplyTo":null,"subject":"[BUG] \"git merge-file\" mismerge","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-07-22T19:19:21Z","receivedAt":"2014-07-22T19:19:21Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Consider these three files:\n\n    $ printf \"%s\\n\" A B C D >ours\n    $ printf \"%s\\n\" A C B D >common\n    $ printf \"%s\\n\" A B D >theirs\n\nStarting from A C B D, our side flips the order of the second (C)\nand the third (B), while their side removes the second (C).\n\nThe correct three-way content level merge should notice conflict\nduring this merge, but \"git merge-file\" that uses xdiff/xmerge.c,\nwhich is meant to be equivalent to \"merge\" from the RCS suite,\ndeclares that our version is already the correct merge result:\n\n    $ merge ours common theirs\n    merge: warning: conflicts during merge\n    $ cat ours\n    A\n    <<<<<<< ours\n    B\n    C\n    =======\n    B\n    >>>>>>> theirs\n    D\n    $ printf \"%s\\n\" A B C D >ours ;# revert it back\n    $ git merge-file ours common theirs ; echo $?\n    0\n    $ cat ours\n    A\n    B\n    C\n    D\n\n\n    \n    \n"}]}