git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] worktree: clarify --expire applies to missing worktrees
@ 2025-12-19 15:00 Sam Bostock via GitGitGadget
  2025-12-19 15:11 ` Eric Sunshine
  2025-12-19 18:16 ` [PATCH v2 0/2] " Sam Bostock via GitGitGadget
  0 siblings, 2 replies; 11+ messages in thread
From: Sam Bostock via GitGitGadget @ 2025-12-19 15:00 UTC (permalink / raw)
  To: git; +Cc: Sam Bostock, Sam Bostock

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.

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

Signed-off-by: Sam Bostock <sam@sambostock.ca>
---
    worktree: clarify --expire applies to missing worktrees

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2135%2Fsambostock%2Fexpire-missing-worktrees-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2135/sambostock/expire-missing-worktrees-v1
Pull-Request: https://github.com/git/git/pull/2135

 Documentation/git-worktree.adoc | 2 +-
 builtin/worktree.c              | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Documentation/git-worktree.adoc b/Documentation/git-worktree.adoc
index f272f79783..402d363064 100644
--- a/Documentation/git-worktree.adoc
+++ b/Documentation/git-worktree.adoc
@@ -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>_.
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>")),
 		OPT_END()
 	};
 
@@ -1070,7 +1070,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()

base-commit: c4a0c8845e2426375ad257b6c221a3a7d92ecfda
-- 
gitgitgadget

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2025-12-20  8:23 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).