Community
Participate
Working Groups
How to reproduce: 1. Set up a repository so that a real recursive merge is necessary (criss-cross) and there is a merge conflict 2. Merge using MergeCommand (not directly using RecursiveMerger) Expected: MergeResult has CONFLICTING status Actual: An exception is thrown: Caused by: org.eclipse.jgit.errors.NoMergeBaseException: No merge base could be determined. Reason=CONFLICTS_DURING_MERGE_BASE_CALCULATION. "More than 200 merge bases for: a 3782cb9fd95b14a0a65ff1d3a4a0979d143fcbe8 b dfab13c375aed49bb9d2f5b180602c19c99d2e8c found: count 2" at org.eclipse.jgit.merge.RecursiveMerger.getBaseCommit(RecursiveMerger.java:203) at org.eclipse.jgit.merge.RecursiveMerger.getBaseCommit(RecursiveMerger.java:126) at org.eclipse.jgit.merge.Merger.getBaseCommit(Merger.java:253) at org.eclipse.jgit.api.MergeCommand.call(MergeCommand.java:394) ... 30 more Fix upcoming.
https://git.eclipse.org/r/17436
Merged by Christian: https://git.eclipse.org/c/jgit/jgit.git/commit/?id=7dc8a4f089c1ca4762cf6fbf2e77898607a5820a
Duplicate: http://stackoverflow.com/questions/20520640/egit-more-than-200-bases-exception-on-merge
There still remains a possibility of NoMergeBaseException for criss-cross merge. For example, with this topology: ---1---o---A \ / X / \ ---2---o---B The exception will be thrown when merge A and B if 1 and 2 conflicts. I guess jgit tries to merge merge bases between A and B and throws the exception if the merge bases conflict.
Could you open a new bug report for this? I'm also interested in what C Git does in a case like that.
A little background on the jgit merge impl: it's right: when jgit want's to merge two commits (A,B) and he finds out that these two commits have multiple common ancestors (1,2) then jgit will try try to produce a single common ancestor (3) by merging (1,2). I think native git does the same. I got that from the "recursive" section in [1]. Of course temporarily merging (1,2) can again lead into a situation with multiple common ancestors (1b, 2b) (criss-cross-criss-cross.....). Then the algorithm runs recursively to merge together (1b,2b) and use the result as ancestor to merge (1,2) and use the result as a ancestor to merge (A,B). If merging common ancestors lead to conflicts then jgit gives up. Would be interesting to see what native git does. [1] http://git-scm.com/docs/git-merge#_merge_strategies
I have opened a new bug report here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=438203