Subject: Re: RFC: git bisect worktrees ../wk-A:../wk-B

From: Junio C Hamano <[email-masked]>
Date: Fri, 21 Mar 2025 01:19:19 -0700

[email-masked] writes:

> hello all,
>
> it would be super convenient if git bisect was able
> to flip-flop between 2 (or more) worktrees while bisecting.
>
> This would leave both A, B in re-test-able states,
> allowing detailed forensics on the differences.

Many small questions come to mind, including "why two, not arbitrary
N?".

A bit more constructively, I think you should be able to build the
machinery around "git bisect --no-checkout".  In "no-checkout" mode,
the bisection machinery is used only to compute which one to try,
and then you can update your own checkout you choose, which can span
across multiple working trees.

And that machinery you'd build around "git bisect --no-checkout"
would be the place to answer those many small questions like "you
can use N worktrees round-robin fashion to keep the last N states
for comparison---what should the value of N?".

> if this were a well-known feature, I could imagine that
> tools like rr would be enhanced to exploit it,

So, if you are planning to teach third-party tools and enhance them,
the feature for them to exploit already exists, I would say, in the
form of "bisect --no-checkout".