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

7 messages from 2016-03-24 to 2016-03-24. Participants: Ralf Thielow, Junio C Hamano, Philip Oakley.
Thread: https://gitlist.dev/t/41813

## Ralf Thielow, 2016-03-24 18:27

Subject: [PATCH 0/2] completion: git-help: add missing option and params
Message-ID: <1458844034-12855-1-git-send-email-ralf.thielow@gmail.com>
URL: https://gitlist.dev/e/1458844034-12855-1-git-send-email-ralf.thielow%40gmail.com

```
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, 2016-03-24 18:27

Subject: [PATCH 1/2] completion: add option '--guides' to 'git help'
Message-ID: <1458844034-12855-2-git-send-email-ralf.thielow@gmail.com>
URL: https://gitlist.dev/e/1458844034-12855-2-git-send-email-ralf.thielow%40gmail.com
In-Reply-To: <1458844034-12855-1-git-send-email-ralf.thielow@gmail.com>

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

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

```

## Ralf Thielow, 2016-03-24 18:27

Subject: [PATCH 2/2] completion: add 'revisions' and 'everyday' to 'git help'
Message-ID: <1458844034-12855-3-git-send-email-ralf.thielow@gmail.com>
URL: https://gitlist.dev/e/1458844034-12855-3-git-send-email-ralf.thielow%40gmail.com
In-Reply-To: <1458844034-12855-1-git-send-email-ralf.thielow@gmail.com>

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

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, 2016-03-24 20:01

Subject: Re: [PATCH 1/2] completion: add option '--guides' to 'git help'
Message-ID: <xmqqbn638x2i.fsf@gitster.mtv.corp.google.com>
URL: https://gitlist.dev/e/xmqqbn638x2i.fsf%40gitster.mtv.corp.google.com
In-Reply-To: <1458844034-12855-2-git-send-email-ralf.thielow@gmail.com>

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

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

```

## Junio C Hamano, 2016-03-24 20:08

Subject: Re: [PATCH 2/2] completion: add 'revisions' and 'everyday' to 'git help'
Message-ID: <xmqq7fgr8wqc.fsf@gitster.mtv.corp.google.com>
URL: https://gitlist.dev/e/xmqq7fgr8wqc.fsf%40gitster.mtv.corp.google.com
In-Reply-To: <1458844034-12855-3-git-send-email-ralf.thielow@gmail.com>

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


> 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, 2016-03-24 20:15

Subject: Re: [PATCH 2/2] completion: add 'revisions' and 'everyday' to 'git help'
Message-ID: <B40A8BBB3787424787785220EA6BFCFE@PhilipOakley>
URL: https://gitlist.dev/e/B40A8BBB3787424787785220EA6BFCFE%40PhilipOakley
In-Reply-To: <xmqq7fgr8wqc.fsf@gitster.mtv.corp.google.com>

```
From: "Junio C Hamano" <gitster@pobox.com>
> 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?

>
> 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, 2016-03-24 21:45

Subject: Re: [PATCH 2/2] completion: add 'revisions' and 'everyday' to 'git help'
Message-ID: <xmqqmvpn7doj.fsf@gitster.mtv.corp.google.com>
URL: https://gitlist.dev/e/xmqqmvpn7doj.fsf%40gitster.mtv.corp.google.com
In-Reply-To: <B40A8BBB3787424787785220EA6BFCFE@PhilipOakley>

```
"Philip Oakley" <philipoakley@iee.org> writes:

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

```
