Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] RevSort#COMMIT_TIME_DESC confusion

On Fri, Aug 12, 2011 at 12:21, Marc Strapetz <marc.strapetz@xxxxxxxxxxx> wrote:
>> Don't do this. Instead use RevWalk.isMergedInto(TARGET, SRC).
>
> That's definitely a better solution, thanks for pointing out. I'll
> probably need some more general methods:
>
> RevWalk.isAnyMergedTo(List<> BASES, TIP)
>
> and
>
> RevWalk.isMergedToAny(BASE, List<> TIPS)
>
> MergeBaseGenerator looks somewhat specific to me and JavaDoc states:
> "The maximum number of starting commits is bounded by the number of free
> flags available in the RevWalk when the generator is initialized.". So
> I'd probably implement this by two utility methods, creating their own
> RevWalk.

Discarding and creating a new RevWalk on each call is a bit ugly.
Right now there are 26 flags free in a RevWalk when it is first
initialized. So that is the maximum number of starting points you can
run at once. In your generalized form of isMergedToAny or
isAnyMergedTo you would have to run in batches if the List argument
had more than 25 inputs.

> Should I keep them local to our project or submit as patch? In
> latter case, any suggestions where to place that methods?

Operations like `git branch --contains` need something like this. So
we would appreciate a contribution to RevWalk or a new class in that
same package that makes this operation easy in JGit.

-- 
Shawn.


Back to the top