Subject: Re: limiting git branch --contains

From: Derrick Stolee <[email-masked]>
Date: Fri, 24 Mar 2023 14:20:01 -0400

On 3/24/2023 2:15 PM, Oswald Buddenhagen wrote:
> On Fri, Mar 24, 2023 at 01:23:32PM -0400, Derrick Stolee wrote:
>> Could you make sure to run 'git commit-graph write --reachable' before
>> testing again?
>>
> i did, didn't help.
> 
> but regardless, even if this would improve things by an order of magnitude (or even two), it would be still wasteful, given that the expected working set contains a few tens commits, while the whole graph contains well over a million commits.

Hm. The point is that it _should_ improve things by several orders
of magnitude by using generation numbers to avoid walking a
significant portion of the commits. That is, unless the commit is
extremely old.

But what you were originally asking was also about filtering the
set of branches to pick, instead of just the commits that are
walked.

In that case, perhaps you should use 

  git for-each-ref --format="%(refname)" --contains=<oid> <ref1> <ref2> ... <refN>

or use ref patterns instead of exact refs, if you have such a
grouping?

Thanks,
-Stolee