worktree: clarify --expire applies to missing worktrees

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.

This updates the help text and documentation to consistently describe
these as "missing worktrees".

Signed-off-by: Sam Bostock <sam@sambostock.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Sam Bostock 2025-12-19 18:16:08 +00:00 committed by Junio C Hamano
parent 9a2fb147f2
commit 20684baa34
2 changed files with 3 additions and 3 deletions

View File

@ -271,7 +271,7 @@ mismatch, even if the links are correct.
With `list`, output additional information about worktrees (see below).
`--expire <time>`::
With `prune`, only expire unused worktrees older than _<time>_.
With `prune`, only expire missing worktrees older than _<time>_.
+
With `list`, annotate missing worktrees as prunable if they are older than
_<time>_.

View File

@ -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>")),
OPT_END()
};
@ -1063,7 +1063,7 @@ static int list(int ac, const char **av, const char *prefix,
OPT_BOOL(0, "porcelain", &porcelain, N_("machine-readable output")),
OPT__VERBOSE(&verbose, N_("show extended annotations and reasons, if available")),
OPT_EXPIRY_DATE(0, "expire", &expire,
N_("add 'prunable' annotation to worktrees older than <time>")),
N_("add 'prunable' annotation to missing worktrees older than <time>")),
OPT_SET_INT('z', NULL, &line_terminator,
N_("terminate records with a NUL character"), '\0'),
OPT_END()