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

On Wed, Jul 7, 2010 at 12:21 AM, Shawn O. Pearce <spearce@xxxxxxxxxxx> wrote:
> Actually, if you pump the RevWalk again by calling next() a second
> time, it will return either null or the 2nd merge base if there are
> multiple merge bases available.  So to find all of them, just pump
> next() until it returns null.  :-)

Nice! Good to know that the recursion isn't needed here.

> FWIW, we prefer parseCommit() rather than lookupCommit() when
> converting from a Ref or ObjectId into a RevCommit.  There are two
> good reasons for this:

Thanks for this information. I've change it. This saves me lots of
code to handle comparing tags and branches.

> Like I said, if you can't do the full recursive merge here (and
> you probably can't) use the first.

Indeed having first merge base is a good solution here, I'll leave it
as it is right now.

One more question, is it possible that there wouldn't be any merge
base? eg. first call of next() would return null ?

Best regards

GSM: +48 695 192 160

Back to the top