Skip to contentSkip to conversation

worktree: include repair cmd in usage

PATCH Superseded Des Preston via GitGitGadget 4 participants 9 messages Mar 25, 2022 – Mar 29, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 worktree: include repair cmd in usage

From: Des Preston <[email protected]>

The worktree repair command was not added to the usage menu for the worktree command. This commit adds the usage of 'worktree repair' according to the existing docs.

---
worktree: include repair cmd in usage

I'm working on an extension for the github CLI (github.com/cli/cli) to make it easier to create and manage worktrees using Github info (github.comm/despreston/gh-worktree). I noticed there was a worktree command that wasn't showing up in the usage menu git worktree -h.

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1188%2Fdespreston%2Fworktree-usage-repair-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1188/despreston/worktree-usage-repair-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1188

 builtin/worktree.c | 1 +
 1 file changed, 1 insertion(+)
builtin/worktree.c +1 -0
index 2838254f7f2..8682ff4c417 100644
@@ -22,6 +22,7 @@ static const char * const worktree_usage[] = {
 	N_("git worktree move <worktree> <new-path>"),
 	N_("git worktree prune [<options>]"),
 	N_("git worktree remove [<options>] <worktree>"),
+	N_("git worktree repair [<path>]"),
 	N_("git worktree unlock <path>"),
 	NULL
 };

base-commit: 4c53a8c20f8984adb226293a3ffd7b88c3f4ac1a

Signature · 1 line
gitgitgadget
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Des Preston via GitGitGadget

The worktree repair command was not added to the usage menu for the worktree command. This commit adds the usage of 'worktree repair' according to the existing docs.

Thanks for fixing my oversight. This certainly should have been done by e8e1ff24c5 (worktree: add skeleton "repair" command, 2020-08-27).

One minor comment below...

builtin/worktree.c static const char * const worktree_usage[] = { · line 26

Quoted 7 lines
builtin/worktree.c +1 -0
@@ -22,6 +22,7 @@ static const char * const worktree_usage[] = {
  	N_("git worktree move <worktree> <new-path>"),
  	N_("git worktree prune [<options>]"),
  	N_("git worktree remove [<options>] <worktree>"),
+	N_("git worktree repair [<path>]"),
  	N_("git worktree unlock <path>"),

The usage message should reflect the fact that git worktree repair can accept multiple paths, thus:

    N_("git worktree repair [<path>...]"),

which would also make it consistent with the synopsis in Documentation/worktree.txt.

With that change applied, consider this:

#2 lore raw

v2 cover worktree: include repair cmd in usage

In reply to Des Preston via GitGitGadget

I'm working on an extension for the github CLI (github.com/cli/cli) to make it easier to create and manage worktrees using Github info (github.comm/despreston/gh-worktree). I noticed there was a worktree command that wasn't showing up in the usage menu git worktree -h.

Des Preston (2):
worktree: include repair cmd in usage
worktree: accept multiple paths

 builtin/worktree.c | 1 +
 1 file changed, 1 insertion(+)

base-commit: 4c53a8c20f8984adb226293a3ffd7b88c3f4ac1a
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1188%2Fdespreston%2Fworktree-usage-repair-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1188/despreston/worktree-usage-repair-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/1188

Range-diff vs v1:

 1:  e0bfbfd5320 = 1:  e0bfbfd5320 worktree: include repair cmd in usage
 -:  ----------- > 2:  1df005a4ef1 worktree: accept multiple paths
Signature · 1 line
gitgitgadget
#3 lore raw

PATCH v2 1/2 worktree: include repair cmd in usage

From: Des Preston <[email protected]>

The worktree repair command was not added to the usage menu for the worktree command. This commit adds the usage of 'worktree repair' according to the existing docs.

---
 builtin/worktree.c | 1 +
 1 file changed, 1 insertion(+)
builtin/worktree.c +1 -0
index 2838254f7f2..8682ff4c417 100644
@@ -22,6 +22,7 @@ static const char * const worktree_usage[] = {
 	N_("git worktree move <worktree> <new-path>"),
 	N_("git worktree prune [<options>]"),
 	N_("git worktree remove [<options>] <worktree>"),
+	N_("git worktree repair [<path>]"),
 	N_("git worktree unlock <path>"),
 	NULL
 };
Signature · 1 line
gitgitgadget
#4 lore raw

PATCH v2 2/2 worktree: accept multiple paths

In reply to Des Preston via GitGitGadget

From: Des Preston <[email protected]>

Update the worktree usage to show that the repair command can take multiple paths.

---
 builtin/worktree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
builtin/worktree.c +1 -1
index 8682ff4c417..498975c1fd9 100644
@@ -22,7 +22,7 @@ static const char * const worktree_usage[] = {
 	N_("git worktree move <worktree> <new-path>"),
 	N_("git worktree prune [<options>]"),
 	N_("git worktree remove [<options>] <worktree>"),
-	N_("git worktree repair [<path>]"),
+	N_("git worktree repair [<path>...]"),
 	N_("git worktree unlock <path>"),
 	NULL
 };
Signature · 1 line
gitgitgadget
#5 lore raw

Re: [PATCH v2 2/2] worktree: accept multiple paths

Quoted 15 lines · Des Preston via GitGitGadget

From: Des Preston <[email protected]>

Update the worktree usage to show that the repair command can take multiple paths.

---
 builtin/worktree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
builtin/worktree.c +0 -0
index 8682ff4c417..498975c1fd9 100644

builtin/worktree.c static const char * const worktree_usage[] = { · line 25

Quoted 5 lines
builtin/worktree.c +1 -1
@@ -22,7 +22,7 @@ static const char * const worktree_usage[] = {
 	N_("git worktree move <worktree> <new-path>"),
 	N_("git worktree prune [<options>]"),
 	N_("git worktree remove [<options>] <worktree>"),
-	N_("git worktree repair [<path>]"),
+	N_("git worktree repair [<path>...]"),

The fact that this line was introduced in [PATCH 1/2] and then needed to immediately be corrected with this patch means the previous patch was suboptimal and this patch is "oops, the last one was bad and here is a band-aid fix-up".

Let's not do so. Instead, you are encouraged to pretend to be a more perfect developer who does not make unnecessary mistake ;-)

#6 lore raw

Re: [PATCH v2 2/2] worktree: accept multiple paths

k.

Quoted 33 lines · Junio C Hamano
Quoted 15 lines · "Des Preston via GitGitGadget

From: Des Preston <[email protected]>

Update the worktree usage to show that the repair command can take multiple paths.

---
builtin/worktree.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
builtin/worktree.c +0 -0
index 8682ff4c417..498975c1fd9 100644

builtin/worktree.c static const char * const worktree_usage[] = { · line 25

Quoted 5 lines
builtin/worktree.c +1 -1
@@ -22,7 +22,7 @@ static const char * const worktree_usage[] = {
   N_("git worktree move <worktree> <new-path>"),
   N_("git worktree prune [<options>]"),
   N_("git worktree remove [<options>] <worktree>"),
-    N_("git worktree repair [<path>]"),
+    N_("git worktree repair [<path>...]"),

The fact that this line was introduced in [PATCH 1/2] and then needed to immediately be corrected with this patch means the previous patch was suboptimal and this patch is "oops, the last one was bad and here is a band-aid fix-up".

Let's not do so. Instead, you are encouraged to pretend to be a more perfect developer who does not make unnecessary mistake ;-)

#7 lore raw

Re: [PATCH v2 2/2] worktree: accept multiple paths

Quoted 30 lines · Desmond Preston
Quoted 30 lines · Junio C Hamano
Quoted 15 lines · "Des Preston via GitGitGadget

From: Des Preston <[email protected]>

Update the worktree usage to show that the repair command can take multiple paths.

---
builtin/worktree.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
builtin/worktree.c +0 -0
index 8682ff4c417..498975c1fd9 100644

builtin/worktree.c static const char * const worktree_usage[] = { · line 25

Quoted 5 lines
builtin/worktree.c +1 -1
@@ -22,7 +22,7 @@ static const char * const worktree_usage[] = {
   N_("git worktree move <worktree> <new-path>"),
   N_("git worktree prune [<options>]"),
   N_("git worktree remove [<options>] <worktree>"),
-    N_("git worktree repair [<path>]"),
+    N_("git worktree repair [<path>...]"),

The fact that this line was introduced in [PATCH 1/2] and then needed to immediately be corrected with this patch means the previous patch was suboptimal and this patch is "oops, the last one was bad and here is a band-aid fix-up".

Quoted 4 lines
Quoted 3 lines

Let's not do so. Instead, you are encouraged to pretend to be a more perfect developer who does not make unnecessary mistake ;-)

k.

FYI, I've queued [1/2] with the fix-up in [2/2] squashed in.

Thanks.

----- >8 --------- >8 --------- >8 --------- >8 --------- >8 -----
From: Des Preston <[email protected]>
Date: Mon, 28 Mar 2022 20:47:05 +0000
Subject: [PATCH] worktree: include repair cmd in usage

The worktree repair command was not added to the usage menu for the worktree command. This commit adds the usage of 'worktree repair' according to the existing docs.

---
 builtin/worktree.c | 1 +
 1 file changed, 1 insertion(+)
builtin/worktree.c +1 -0
index 2838254f7f..498975c1fd 100644
@@ -22,6 +22,7 @@ static const char * const worktree_usage[] = {
 	N_("git worktree move <worktree> <new-path>"),
 	N_("git worktree prune [<options>]"),
 	N_("git worktree remove [<options>] <worktree>"),
+	N_("git worktree repair [<path>...]"),
 	N_("git worktree unlock <path>"),
 	NULL
 };
Signature · 1 line
2.35.1-850-g6c97ec7725
#8 lore raw

Re: [PATCH v2 2/2] worktree: accept multiple paths

Quoted 6 lines · Junio C Hamano
Quoted 5 lines · Desmond Preston
Quoted 5 lines

The fact that this line was introduced in [PATCH 1/2] and then needed to immediately be corrected with this patch means the previous patch was suboptimal and this patch is "oops, the last one was bad and here is a band-aid fix-up".

Quoted 8 lines
Quoted 2 lines
Quoted 2 lines

Let's not do so. Instead, you are encouraged to pretend to be a more perfect developer who does not make unnecessary mistake ;-)

FYI, I've queued [1/2] with the fix-up in [2/2] squashed in.

N_("git worktree remove [<options>] <worktree>"),
+ N_("git worktree repair [<path>...]"),
N_("git worktree unlock <path>"),

This version looks good to me and addresses my review comments[*], and still has my Acked-by: for what it's worth.

Thanks for putting the finishing touches on this.

[*]: https://lore.kernel.org/git/[email protected]/