DiffLib icon indicating copy to clipboard operation
DiffLib copied to clipboard

Potentially "incorrect" merge (diff?) behavior related to similar code

Open lassevk opened this issue 8 years ago • 1 comments

I tried to merge the following scenario:

base:   {}
left:   {a}
right:  {} {b}

This is what I want to happen:

base:   {}
left:   {a}
right:  {} {b}
merged: {a} {b}
         + ++++

Instead a merge conflict happens because the following two blocks ends up being connected and compared:

 +
{a}
{} {b}
 ++++

The expected outcome would merge cleanly, whereas the second will generate a merge conflict.

I need to see if I can make the diff/merge algorithm less greedy in this case.

lassevk avatar Jul 26 '17 15:07 lassevk

The solution for now is to disable the patience optimization when merging as this removes information useful for synchronizing points in the code.

lassevk avatar Jul 27 '17 06:07 lassevk