Re: [PATCH v2] worktree list: add --branch to select worktrees by branch
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Oct 29, 2026, 05:01 UTC
- Message-ID
- <CAPig+cS=u5pDyMxkT-cw+Wt3qfxuFuvmFm0Qm19_mg4JK+Mxdg@mail.gmail.com>
- In-Reply-To
- <20261029044633.12429-1-me@jaspermayone.com>
On Thu, Oct 29, 2026 at 12:46 AM Jasper Mayone <me@jaspermayone.com> wrote:
> Phillip, thank you for the review. Your point that "git worktree > list" output does not say which entry is the main worktree still > stands, and I can send that as a separate patch if it is wanted.
`git worktree list` guarantees that the main worktree (or bare repository) is the very first item; this behavior is documented. I think Philip's point was that once filtering is engaged, you lose that guarantee: in a filtered list, if the main worktree has been filtered away, then the first item will not be the main worktree.