threads / patch / 41813

patch, 2 partscompletion: add option '--guides' to 'git help'

Subject: [PATCH 1/2] completion: add option '--guides' to 'git help'

## tl;dr

7 messages between Mar 24, 2016 and Mar 24, 2016. Diffs are folded; open one to read it.

replies: 6people: 3as markdown or json

Ralf Thielow· Mar 24, 2016, 18:27 UTC · lore

[PATCH 0/2] completion: git-help: add missing option and params

The bash completion is missing the option '--guides' for 'git-help' and some params you see there. Add them both.

Ralf Thielow (2):
  completion: add option '--guides' to 'git help'
  completion: add 'revisions' and 'everyday' to 'git help'
 contrib/completion/git-completion.bash | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
-- 
2.8.0.rc4.7.g35d7ca9.dirty
Ralf Thielow· Mar 24, 2016, 18:27 UTC · re: Ralf Thielow · lore
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
---
 contrib/completion/git-completion.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Show changes to contrib/completion/git-completion.bash +1 −1
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index e3918c8..70f4171 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1339,7 +1339,7 @@ _git_help ()
 {
 	case "$cur" in
 	--*)
-		__gitcomp "--all --info --man --web"
+		__gitcomp "--all --guides --info --man --web"
 		return
 		;;
 	esac
-- 
2.8.0.rc4.7.g35d7ca9.dirty
Junio C Hamano· Mar 24, 2016, 20:01 UTC · re: Ralf Thielow · lore

Re: [PATCH 1/2] completion: add option '--guides' to 'git help'

Ralf Thielow <ralf.thielow@gmail.com> writes:
> Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
> ---
>  contrib/completion/git-completion.bash | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
Sounds sensible.  Thanks.
Show 14 quoted lines
>
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index e3918c8..70f4171 100644
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -1339,7 +1339,7 @@ _git_help ()
>  {
>  	case "$cur" in
>  	--*)
> -		__gitcomp "--all --info --man --web"
> +		__gitcomp "--all --guides --info --man --web"
>  		return
>  		;;
>  	esac
Ralf Thielow· Mar 24, 2016, 18:27 UTC · re: Ralf Thielow · lore

[PATCH 2/2] completion: add 'revisions' and 'everyday' to 'git help'

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
---
 contrib/completion/git-completion.bash | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Show changes to contrib/completion/git-completion.bash +2 −2
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 70f4171..ffe6004 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1346,8 +1346,8 @@ _git_help ()
 	__git_compute_all_commands
 	__gitcomp "$__git_all_commands $(__git_aliases)
 		attributes cli core-tutorial cvs-migration
-		diffcore gitk glossary hooks ignore modules
-		namespaces repository-layout tutorial tutorial-2
+		diffcore everyday gitk glossary hooks ignore modules
+		namespaces repository-layout revisions tutorial tutorial-2
 		workflows
 		"
 }
-- 
2.8.0.rc4.7.g35d7ca9.dirty
Junio C Hamano· Mar 24, 2016, 20:08 UTC · re: Ralf Thielow · lore

Re: [PATCH 2/2] completion: add 'revisions' and 'everyday' to 'git help'

Ralf Thielow <ralf.thielow@gmail.com> writes:
> Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
> ---
>  contrib/completion/git-completion.bash | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

It is somewhat silly that we have to maintain this list to be in sync with the set of documents we offer. Wouldn't it make more sense to go in the direction of _removing_ this list of hardcoded words here?

The first step may be to teach a new subcommand to "git help" to show a list of these words, and then _git_help can use it to lazily compute the list just like __git_commands does.

But this change itself is not wrong per-se; will queue to see where follow-up discussion will lead us to.

Thanks.
Show 15 quoted lines
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index 70f4171..ffe6004 100644
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -1346,8 +1346,8 @@ _git_help ()
>  	__git_compute_all_commands
>  	__gitcomp "$__git_all_commands $(__git_aliases)
>  		attributes cli core-tutorial cvs-migration
> -		diffcore gitk glossary hooks ignore modules
> -		namespaces repository-layout tutorial tutorial-2
> +		diffcore everyday gitk glossary hooks ignore modules
> +		namespaces repository-layout revisions tutorial tutorial-2
>  		workflows
>  		"
>  }
Philip Oakley· Mar 24, 2016, 20:15 UTC · re: Junio C Hamano · lore

Re: [PATCH 2/2] completion: add 'revisions' and 'everyday' to 'git help'

From: "Junio C Hamano" <gitster@pobox.com>
Show 15 quoted lines
> Ralf Thielow <ralf.thielow@gmail.com> writes:
>
>> Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
>> ---
>>  contrib/completion/git-completion.bash | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> It is somewhat silly that we have to maintain this list to be in
> sync with the set of documents we offer.  Wouldn't it make more
> sense to go in the direction of _removing_ this list of hardcoded
> words here?
>
> The first step may be to teach a new subcommand to "git help"
> to show a list of these words, and then _git_help can use it to
> lazily compute the list just like __git_commands does.

'git help -a' (or --all) already determines the list of commands available, but then formats it prettily for user consumption. Maybe an alternate --list option?

Show 28 quoted lines
>
> But this change itself is not wrong per-se; will queue to see where
> follow-up discussion will lead us to.
>
> Thanks.
>
>
>> diff --git a/contrib/completion/git-completion.bash 
>> b/contrib/completion/git-completion.bash
>> index 70f4171..ffe6004 100644
>> --- a/contrib/completion/git-completion.bash
>> +++ b/contrib/completion/git-completion.bash
>> @@ -1346,8 +1346,8 @@ _git_help ()
>>  __git_compute_all_commands
>>  __gitcomp "$__git_all_commands $(__git_aliases)
>>  attributes cli core-tutorial cvs-migration
>> - diffcore gitk glossary hooks ignore modules
>> - namespaces repository-layout tutorial tutorial-2
>> + diffcore everyday gitk glossary hooks ignore modules
>> + namespaces repository-layout revisions tutorial tutorial-2
>>  workflows
>>  "
>>  }
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
Junio C Hamano· Mar 24, 2016, 21:45 UTC · re: Philip Oakley · lore

Re: [PATCH 2/2] completion: add 'revisions' and 'everyday' to 'git help'

"Philip Oakley" <philipoakley@iee.org> writes:
Show 7 quoted lines
>> The first step may be to teach a new subcommand to "git help"
>> to show a list of these words, and then _git_help can use it to
>> lazily compute the list just like __git_commands does.
>
> 'git help -a' (or --all) already determines the list of commands
> available, but then formats it prettily for user consumption. Maybe an
> alternate --list option?
Yes, that is exactly what I meant.

← back to recent threads