threads / patch / 57618

patchworktree: include repair cmd in usage

Subject: [PATCH] worktree: include repair cmd in usage

## tl;dr

9 messages between Mar 25, 2022 and Mar 29, 2022. Diffs are folded; open one to read it.

replies: 8people: 4as markdown or json

Des Preston via GitGitGadget· Mar 25, 2022, 18:05 UTC · lore
From: Des Preston <despreston@gmail.com>

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.

Signed-off-by: Des Preston <despreston@gmail.com>
---
    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.
    
    Signed-off-by: Des Preston despreston@gmail.com
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(+)
Show changes to builtin/worktree.c +1 −0
diff --git a/builtin/worktree.c b/builtin/worktree.c
index 2838254f7f2..8682ff4c417 100644
--- a/builtin/worktree.c
+++ b/builtin/worktree.c
@@ -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
-- 
gitgitgadget
Eric Sunshine· Mar 25, 2022, 19:55 UTC · re: Des Preston via GitGitGadget · lore

Re: [PATCH] worktree: include repair cmd in usage

On 3/25/22 2:05 PM, Des Preston via GitGitGadget wrote:
Show 5 quoted lines
> 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.
> 
> Signed-off-by: Des Preston <despreston@gmail.com>

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...
Show 7 quoted lines
> diff --git a/builtin/worktree.c b/builtin/worktree.c
> @@ -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:
     Acked-by: Eric Sunshine <sunshine@sunshineco.com>
Des Preston via GitGitGadget· Mar 28, 2022, 20:47 UTC · re: Des Preston via GitGitGadget · lore

[PATCH v2 0/2] 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.

Signed-off-by: Des Preston despreston@gmail.com
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
-- 
gitgitgadget
Des Preston via GitGitGadget· Mar 28, 2022, 20:47 UTC · re: Des Preston via GitGitGadget · lore

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

From: Des Preston <despreston@gmail.com>

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

Signed-off-by: Des Preston <despreston@gmail.com>
---
 builtin/worktree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Show changes to builtin/worktree.c +1 −1
diff --git a/builtin/worktree.c b/builtin/worktree.c
index 8682ff4c417..498975c1fd9 100644
--- a/builtin/worktree.c
+++ b/builtin/worktree.c
@@ -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
 };
-- 
gitgitgadget
Junio C Hamano· Mar 29, 2022, 01:00 UTC · re: Des Preston via GitGitGadget · lore

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

"Des Preston via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 20 quoted lines
> From: Des Preston <despreston@gmail.com>
>
> Update the worktree usage to show that the repair command can take
> multiple paths.
>
> Signed-off-by: Des Preston <despreston@gmail.com>
> ---
>  builtin/worktree.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/builtin/worktree.c b/builtin/worktree.c
> index 8682ff4c417..498975c1fd9 100644
> --- a/builtin/worktree.c
> +++ b/builtin/worktree.c
> @@ -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 ;-)

Desmond Preston· Mar 29, 2022, 03:00 UTC · re: Junio C Hamano · lore

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

k. 
Show 33 quoted lines
> On Mar 28, 2022, at 9:00 PM, Junio C Hamano <gitster@pobox.com> wrote:
> 
> "Des Preston via GitGitGadget" <gitgitgadget@gmail.com> writes:
> 
>> From: Des Preston <despreston@gmail.com>
>> 
>> Update the worktree usage to show that the repair command can take
>> multiple paths.
>> 
>> Signed-off-by: Des Preston <despreston@gmail.com>
>> ---
>> builtin/worktree.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/builtin/worktree.c b/builtin/worktree.c
>> index 8682ff4c417..498975c1fd9 100644
>> --- a/builtin/worktree.c
>> +++ b/builtin/worktree.c
>> @@ -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 ;-)
> 
Junio C Hamano· Mar 29, 2022, 16:01 UTC · re: Desmond Preston · lore

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

Desmond Preston <despreston@gmail.com> writes:
Show 34 quoted lines
>> On Mar 28, 2022, at 9:00 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> 
>> "Des Preston via GitGitGadget" <gitgitgadget@gmail.com> writes:
>> 
>>> From: Des Preston <despreston@gmail.com>
>>> 
>>> Update the worktree usage to show that the repair command can take
>>> multiple paths.
>>> 
>>> Signed-off-by: Des Preston <despreston@gmail.com>
>>> ---
>>> builtin/worktree.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>> 
>>> diff --git a/builtin/worktree.c b/builtin/worktree.c
>>> index 8682ff4c417..498975c1fd9 100644
>>> --- a/builtin/worktree.c
>>> +++ b/builtin/worktree.c
>>> @@ -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 ;-)
>> 
> 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 <despreston@gmail.com>
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.

Signed-off-by: Des Preston <despreston@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 builtin/worktree.c | 1 +
 1 file changed, 1 insertion(+)
Show changes to builtin/worktree.c +1 −0
diff --git a/builtin/worktree.c b/builtin/worktree.c
index 2838254f7f..498975c1fd 100644
--- a/builtin/worktree.c
+++ b/builtin/worktree.c
@@ -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
 };
-- 
2.35.1-850-g6c97ec7725
Eric Sunshine· Mar 29, 2022, 18:36 UTC · re: Junio C Hamano · lore

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

On Tue, Mar 29, 2022 at 12:02 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 14 quoted lines
> Desmond Preston <despreston@gmail.com> writes:
> >> 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 ;-)
>
> 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/3f823608-adf4-f717-13d8-8da6f89a9506@sunshineco.com/
Des Preston via GitGitGadget· Mar 28, 2022, 20:47 UTC · re: Des Preston via GitGitGadget · lore

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

From: Des Preston <despreston@gmail.com>

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.

Signed-off-by: Des Preston <despreston@gmail.com>
---
 builtin/worktree.c | 1 +
 1 file changed, 1 insertion(+)
Show changes to builtin/worktree.c +1 −0
diff --git a/builtin/worktree.c b/builtin/worktree.c
index 2838254f7f2..8682ff4c417 100644
--- a/builtin/worktree.c
+++ b/builtin/worktree.c
@@ -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
 };
-- 
gitgitgadget

← back to recent threads