From: Junio C Hamano <gitster@pobox.com>
To: Jasper Mayone <me@jaspermayone.com>
Cc: git@vger.kernel.org, haraldnordgren@gmail.com,
sunshine@sunshineco.com, ben.knoble@gmail.com
Subject: Re: [RFC PATCH 1/1] worktree list: add --merged and --no-merged
Date: Fri, 23 Oct 2026 11:30:02 -0700 [thread overview]
Message-ID: <xmqqqzhg5kyd.fsf@gitster.g> (raw)
In-Reply-To: <20261021173350.67854-2-me@jaspermayone.com> (Jasper Mayone's message of "Wed, 21 Oct 2026 13:33:37 -0400")
Jasper Mayone <me@jaspermayone.com> writes:
> Users who keep one worktree per topic have no direct way to find the
> worktrees whose work has already landed. "git branch --merged" lists
> the branches, but the user then has to match each branch to a
> worktree by hand, and a detached worktree has no branch to match.
> "git branch --delete-merged" skips any branch that is checked out in
> a worktree, so these are exactly the branches it leaves behind.
Real review on this patch never happened, it seems, perhaps because
a discussion on a side issue distracted everybody?
It looks like the intro unfairly narrows the problem space. Even
for those users who do not use one worktree per topic do need to
find worktrees based on what branch they check out. While I agree
that among the criteria to choose these branches to filter worktrees
on, "--merged" and "--not-merged" may be two of the most useful ones,
the feature does not have to be limited to them.
I wonder if "git worktree list --branch=...", where --branch= can be
given multiple times, is a better primitive? With that you could do
something like
$ git worktree list $(git branch --contains HEAD | sed -e 's/^/--branch=/')
to reuse the same machinery without any extra code.
next prev parent reply other threads:[~2026-10-23 18:30 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-21 17:33 [RFC PATCH 0/1] worktree list: add --merged and --no-merged Jasper Mayone
2026-10-21 17:33 ` [RFC PATCH 1/1] " Jasper Mayone
2026-10-23 18:30 ` Junio C Hamano [this message]
2026-10-24 6:25 ` Eric Sunshine
2026-10-24 16:53 ` [PATCH v2] worktree list: add --branch to select worktrees by branch Jasper Mayone
2026-10-25 14:47 ` Phillip Wood
2026-10-26 11:02 ` Phillip Wood
2026-10-21 21:36 ` [RFC PATCH 0/1] worktree list: add --merged and --no-merged Harald Nordgren
2026-10-21 22:12 ` Junio C Hamano
2026-10-22 7:21 ` Harald Nordgren
2026-10-22 17:58 ` Kristoffer Haugsbakk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqqzhg5kyd.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=ben.knoble@gmail.com \
--cc=git@vger.kernel.org \
--cc=haraldnordgren@gmail.com \
--cc=me@jaspermayone.com \
--cc=sunshine@sunshineco.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox