]> source.dussan.org Git - jgit.git/commit
Improve MergeAlgorithm to produce smaller conflicts 70/1470/1
authorChristian Halstrick <christian.halstrick@sap.com>
Tue, 31 Aug 2010 15:14:07 +0000 (17:14 +0200)
committerChristian Halstrick <christian.halstrick@sap.com>
Tue, 31 Aug 2010 15:14:07 +0000 (17:14 +0200)
commit0c017188b4d41cc80c297e35097095026734b3d4
tree9a5f6df1e1a5709cb3d38fca169fbfe7db95b31b
parent51f6fbda1f515cdf91c0ccb3a50de5f785301f58
Improve MergeAlgorithm to produce smaller conflicts

The merge algorithm was reporting conflicts which where to big.

Example: The common base was "ABC", the "ours" version contained
"AB1C" (the addition of "1" after pos 2) and the "theirs" version also
contained "AB1C". We have two potentially conflicting edits in the
same region which happen to bring in exactly the same content. This
should not be a conflict - but was previously reported as
"AB<<<1===1>>>C".

This is fixed by checking every conflicting chunk whether the
conflicting regions have a common prefix or suffix and by removing
this regions from the conflict.

Change-Id: I4dc169b8ef7a66ec6b307e9a956feef906c9e15e
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/MergeAlgorithmTest.java
org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeAlgorithm.java