Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] Handle multiple merge points when searching for common ancestor

Hi,

> Some time ago Stefan Lay create a bug 317934[1] for synchronization
> view and its common base ancestor. In this bug report he mention about
> 'multiple merge bases', to be honest I'm not centrally sure what it
> means. But I guesses that 'multiple merge bases' are for eg. merge
> commits (when two or more branches are merged) em I right ?

There are cases where two branches have multiple common bases. Have
a look at the last example in [1] to see such a situation. In the context of
merging such situations are solved by merge-strategies which resolve such
problems by first merging together the multiple common bases. The "recursive"
strategy explained in [2] gives some hint. In theory we could do something
similar in the synchronization view as soon ans the resolve strategy
is available.
I fear that this could become to complicated/time consuming for synchronization
view.

Another idea would be that whenever the common base detection returns
multiple bases base1, base2, ... baseN then determine with the same strategy
the common base of base1, base2, ... baseN. Continue that recursive algorithm
until you are left with only one common base.

Ciao
  Chris

[1] http://www.kernel.org/pub/software/scm/git/docs/git-merge-base.html#_discussion
[2] http://www.kernel.org/pub/software/scm/git/docs/git-merge.html#_merge_strategies


Back to the top