Thread (24 messages) 24 messages, 7 authors, 1d ago

Re: [PATCH 0/2] worktree: treat a branch being rebased or bisected as checked out

flat view

From: Junio C Hamano <hidden>
Date: 2026-10-30 22:55:37

Jasper Mayone [off-list ref] 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 <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.

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help