DiffLib
DiffLib copied to clipboard
Potentially "incorrect" merge (diff?) behavior related to similar code
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.
The solution for now is to disable the patience optimization when merging as this removes information useful for synchronizing points in the code.