Re: [PATCH 0/2] worktree: treat a branch being rebased or bisected as checked out
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 30, 2026, 22:55 UTC
- Message-ID
- <xmqqmrruu7bs.fsf@gitster.g>
- In-Reply-To
- <20261030142137.54750-1-me@jaspermayone.com>
Jasper Mayone <me@jaspermayone.com> writes:
> This replaces my "git worktree list --branch" patch [1].
Then please label it as v3 as the old one is v2, or it breaks automation.
Show 13 quoted lines
> In that > thread Kristoffer pointed out that "git for-each-ref --merged <commit> > --format='%(worktreepath)' refs/heads/" already finds the worktrees of > merged branches, so a new option is not needed. What is missing is > that %(worktreepath) ignores a branch while a worktree is rebasing or > bisecting it, although "git worktree add" and "git branch -d" already > treat that branch as checked out. Phillip agreed that this is a bug. > > Ben then asked what happens if such a worktree is passed to "git > worktree remove". Today it is removed, and the rebase or bisect state > is lost with it, if the files happen to be clean. Phillip called that > a bug too, and more likely to be hit once %(worktreepath) reports > these worktrees, so it is fixed first.
All of these address great points. Thanks for working on it.