From: Derrick Stolee <stolee@gmail.com>
To: Kristofer Karlsson <krka@spotify.com>
Cc: git@vger.kernel.org
Subject: Re: [RFC] commit-reach: terminate merge-base walk when one paint side is exhausted
Date: Fri, 12 Jun 2026 11:04:38 -0400 [thread overview]
Message-ID: <8d0902ca-98b7-44a4-a23b-51de44ab6daa@gmail.com> (raw)
In-Reply-To: <CAL71e4OmPzpCXh-zZ8NsT6L4zVKnXV1gqiFZ2w0XgMJhD=LArQ@mail.gmail.com>
On 6/12/2026 10:32 AM, Kristofer Karlsson wrote:
> The required condition must then not be simply "one side exhausted".
> The walk must also continue while non-stale P1|P2 commits remain in the
> queue, since those still need STALE propagation - they are still
> merge-base candidates.
>
> So the actual halt condition would be:
>
> no non-stale P1|P2 candidates in the queue
> AND (no pure-P1 OR no pure-P2)
And since STALE is added only after both P1 and P2 bits, the two
conditions are identical to how queue_has_nonstale() terminates the
loop.
> If this reasoning is correct, then the walk only terminates after
> merge-base candidates have either been processed or marked STALE,
> and the counterexample should produce [B] rather than [B, C].
That's the correct distinction: we need the set [B] and not [B,C]
but we need to discover that B can reach C to remove it from the
result set.
I think there is potential merit in "switching walk modes" to DFS
when all queued commits have both P1 and P2, but it comes with a
lot of complications. So tread carefully if you go down this road.
Thanks,
-Stolee
next prev parent reply other threads:[~2026-06-12 15:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-12 11:15 [RFC] commit-reach: terminate merge-base walk when one paint side is exhausted Kristofer Karlsson
2026-06-12 12:52 ` Derrick Stolee
2026-06-12 14:32 ` Kristofer Karlsson
2026-06-12 15:04 ` Derrick Stolee [this message]
2026-06-12 15:21 ` Kristofer Karlsson
2026-06-12 15:48 ` Derrick Stolee
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8d0902ca-98b7-44a4-a23b-51de44ab6daa@gmail.com \
--to=stolee@gmail.com \
--cc=git@vger.kernel.org \
--cc=krka@spotify.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox