git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: Sam Bostock via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org,  Sam Bostock <sam.bostock@shopify.com>
Subject: Re: [PATCH] worktree: clarify --expire applies to missing worktrees
Date: Sat, 20 Dec 2025 16:31:12 +0900	[thread overview]
Message-ID: <xmqqfr95txrz.fsf@gitster.g> (raw)
In-Reply-To: <CAPig+cTsKgzLvz_BJxTLqRfc5A7CK_FNo_L6TDOGPVGG9eXDCw@mail.gmail.com> (Eric Sunshine's message of "Sat, 20 Dec 2025 02:14:15 -0500")

Eric Sunshine <sunshine@sunshineco.com> writes:

> On Sat, Dec 20, 2025 at 12:44 AM Junio C Hamano <gitster@pobox.com> wrote:
>> I wonder if this would work better.
>>
>>         `prune`::
>>                 Remove worktree information in `$GIT_DIR/worktrees`
>>                 only, without touching the working tree.  This is
>>                 often needed when the working tree is lost (e.g.,
>>                 the user manually removed it) and the worktree
>>                 information has become dangling.
>
> Yes, this is a useful improvement, although one part confuses me (and
> I would omit it). In particular, if the working tree is lost, thus the
> `$GIT_DIR/worktrees` is dangling ought to be removed, then I'm not
> sure why you would say "without touching the working tree" (which is
> already lost).

Ahh, I somehow thought you can say "git worktree prune <worktree>"
to remove only the control information while the working tree is
still there, sort of "orphaning" the working tree from the main
repository.  But things do not work that way.

You're right that "without touching the working tree" part is
misleading and redundant.  And it is not "this is often needed"; it
is the _only_ scenario the operation makes sense.

	`prune`::
		Remove worktree information in `$GIT_DIR/worktrees`
		for worktrees whose working trees are missing.
		Useful after manually removing a working tree that
		is no longer needed (but use "git worktree remove"
		next time you want to do so).  Also if you _moved_ a
		working tree elsewhere to cause the worktree
		information dangling, see "git worktree repair" to
		reconnect the worktree to the new working tree
		location.

perhaps?


  reply	other threads:[~2025-12-20  7:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-19 15:00 [PATCH] worktree: clarify --expire applies to missing worktrees Sam Bostock via GitGitGadget
2025-12-19 15:11 ` Eric Sunshine
2025-12-20  5:44   ` Junio C Hamano
2025-12-20  7:14     ` Eric Sunshine
2025-12-20  7:31       ` Junio C Hamano [this message]
2025-12-20  8:23         ` Eric Sunshine
2025-12-19 18:16 ` [PATCH v2 0/2] " Sam Bostock via GitGitGadget
2025-12-19 18:16   ` [PATCH v2 1/2] " Sam Bostock via GitGitGadget
2025-12-20  6:07     ` Junio C Hamano
2025-12-19 18:16   ` [PATCH v2 2/2] worktree: use 'prune' instead of 'expire' in help text Sam Bostock via GitGitGadget
2025-12-20  6:11     ` Junio C Hamano

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=xmqqfr95txrz.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=sam.bostock@shopify.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;
as well as URLs for NNTP newsgroup(s).