Re: [PATCH v2 1/2] worktree: clarify --expire applies to missing worktrees
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 20, 2025, 06:07 UTC
- Message-ID
- <xmqqqzspu1nn.fsf@gitster.g>
- In-Reply-To
- <ddd4191ecb391e10bf4b123f699384a3d609b4a8.1766168169.git.gitgitgadget@gmail.com>
"Sam Bostock via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 6 quoted lines
> From: Sam Bostock <sam.bostock@shopify.com> > > The `--expire` option for `git worktree list` and `git worktree prune` > only affects worktrees whose working directory path no longer exists. > The help text did not make this clear, and the documentation > inconsistently used "unused" for prune but "missing" for list.
Well analyzed and described.
> This updates the help text and documentation to consistently describe > these as "missing worktrees".
We phrase it more like "Update the help text and documentation to ...", as if you are asking somebody sitting on the keyboard to make that change.
Show 10 quoted lines
> diff --git a/builtin/worktree.c b/builtin/worktree.c
> index fbdaf2eb2e..82fcbfeccf 100644
> --- a/builtin/worktree.c
> +++ b/builtin/worktree.c
> @@ -252,7 +252,7 @@ static int prune(int ac, const char **av, const char *prefix,
> OPT__DRY_RUN(&show_only, N_("do not remove, show only")),
> OPT__VERBOSE(&verbose, N_("report pruned working trees")),
> OPT_EXPIRY_DATE(0, "expire", &expire,
> - N_("expire working trees older than <time>")),
> + N_("expire missing working trees older than <time>")),"expire" -> "prune" or "remove". As the user already said "prune" when they run "git worktree prune -h", using a different and more common verb "remove" to explain the action might be more helpful than saying "prune".
Thanks.