From: Junio C Hamano Date: Fri, 30 Oct 2026 22:55:35 GMT Subject: Re: [PATCH 0/2] worktree: treat a branch being rebased or bisected as checked out Message-ID: In-Reply-To: <20261030142137.54750-1-me@jaspermayone.com> Jasper Mayone 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. > In that > thread Kristoffer pointed out that "git for-each-ref --merged > --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.