git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-completion: offer references for 'git reflog'
@ 2011-09-25 10:42 Michael Schubert
  2011-10-04  8:48 ` Michael Schubert
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Schubert @ 2011-09-25 10:42 UTC (permalink / raw)
  To: git

'git reflog <ref>' is a valid command, therefore offer reference
completion.

Signed-off-by: Michael Schubert <mschub@elegosoft.com>
---
 contrib/completion/git-completion.bash |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 8648a36..63d0f08 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1774,7 +1774,7 @@ _git_reflog ()
 	local subcommand="$(__git_find_on_cmdline "$subcommands")"
 
 	if [ -z "$subcommand" ]; then
-		__gitcomp "$subcommands"
+		__gitcomp "$subcommands $(__git_refs)"
 	else
 		__gitcomp "$(__git_refs)"
 	fi
-- 
1.7.7.rc3

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

* Re: [PATCH] git-completion: offer references for 'git reflog'
  2011-09-25 10:42 [PATCH] git-completion: offer references for 'git reflog' Michael Schubert
@ 2011-10-04  8:48 ` Michael Schubert
  2011-10-04 17:05   ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Schubert @ 2011-10-04  8:48 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

On 09/25/2011 12:42 PM, Michael Schubert wrote:
> 'git reflog <ref>' is a valid command, therefore offer reference
> completion.
> 
> Signed-off-by: Michael Schubert <mschub@elegosoft.com>
> ---
>  contrib/completion/git-completion.bash |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index 8648a36..63d0f08 100755
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -1774,7 +1774,7 @@ _git_reflog ()
>  	local subcommand="$(__git_find_on_cmdline "$subcommands")"
>  
>  	if [ -z "$subcommand" ]; then
> -		__gitcomp "$subcommands"
> +		__gitcomp "$subcommands $(__git_refs)"
>  	else
>  		__gitcomp "$(__git_refs)"
>  	fi

Ping.?

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

* Re: [PATCH] git-completion: offer references for 'git reflog'
  2011-10-04  8:48 ` Michael Schubert
@ 2011-10-04 17:05   ` Junio C Hamano
  2011-10-04 19:34     ` Michael Schubert
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2011-10-04 17:05 UTC (permalink / raw)
  To: Michael Schubert; +Cc: git

Michael Schubert <mschub@elegosoft.com> writes:

> On 09/25/2011 12:42 PM, Michael Schubert wrote:
>> 'git reflog <ref>' is a valid command, therefore offer reference
>> completion.
>> 
>> Signed-off-by: Michael Schubert <mschub@elegosoft.com>
>> ---
>>  contrib/completion/git-completion.bash |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>> 
>> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
>> index 8648a36..63d0f08 100755
>> --- a/contrib/completion/git-completion.bash
>> +++ b/contrib/completion/git-completion.bash
>> @@ -1774,7 +1774,7 @@ _git_reflog ()
>>  	local subcommand="$(__git_find_on_cmdline "$subcommands")"
>>  
>>  	if [ -z "$subcommand" ]; then
>> -		__gitcomp "$subcommands"
>> +		__gitcomp "$subcommands $(__git_refs)"
>>  	else
>>  		__gitcomp "$(__git_refs)"
>>  	fi
>
> Ping.?

Personally I think this change will give much less pleasant user
experience.  This is what I currently get:

    $ git reflog <TAB>
    delete  expire  show
    $ git reflog

and after learning the "show" subcommand exists, this is what I would get:

    $ git reflog show <TAB>
    Display all 626 possibilities? (y or n)

With your change, I would get:

    $ git reflog <TAB>
    Display all 629 possibilities? (y or n)

and do not even have a chance to remind myself if the subcommand to drop
a reflog was "delete" or "remove".

At least when I know that I want to be reminded of refs to $verb (use one
of the three subcommands I currently get in place of the "$verb"), I can
say

    $ git reflog $verb <TAB>

and at that point, I am willing to wade thru list of 600+ refs.

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

* Re: [PATCH] git-completion: offer references for 'git reflog'
  2011-10-04 17:05   ` Junio C Hamano
@ 2011-10-04 19:34     ` Michael Schubert
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Schubert @ 2011-10-04 19:34 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On 10/04/2011 07:05 PM, Junio C Hamano wrote:
> Michael Schubert <mschub@elegosoft.com> writes:
> 
>> On 09/25/2011 12:42 PM, Michael Schubert wrote:
>>> 'git reflog <ref>' is a valid command, therefore offer reference
>>> completion.
>>>
>>> Signed-off-by: Michael Schubert <mschub@elegosoft.com>
>>> ---
>>>  contrib/completion/git-completion.bash |    2 +-
>>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
>>> index 8648a36..63d0f08 100755
>>> --- a/contrib/completion/git-completion.bash
>>> +++ b/contrib/completion/git-completion.bash
>>> @@ -1774,7 +1774,7 @@ _git_reflog ()
>>>  	local subcommand="$(__git_find_on_cmdline "$subcommands")"
>>>  
>>>  	if [ -z "$subcommand" ]; then
>>> -		__gitcomp "$subcommands"
>>> +		__gitcomp "$subcommands $(__git_refs)"
>>>  	else
>>>  		__gitcomp "$(__git_refs)"
>>>  	fi
>>
>> Ping.?
> 
> Personally I think this change will give much less pleasant user
> experience.  This is what I currently get:
> 
>     $ git reflog <TAB>
>     delete  expire  show
>     $ git reflog
> 
> and after learning the "show" subcommand exists, this is what I would get:
> 
>     $ git reflog show <TAB>
>     Display all 626 possibilities? (y or n)
> 
> With your change, I would get:
> 
>     $ git reflog <TAB>
>     Display all 629 possibilities? (y or n)

Yeah, that would be a tradeoff. IMHO the current behaviour is pleasant
for newcomers, but (I guess) most users would rather enjoy "the short form".

> and do not even have a chance to remind myself if the subcommand to drop
> a reflog was "delete" or "remove".
> 
> At least when I know that I want to be reminded of refs to $verb (use one
> of the three subcommands I currently get in place of the "$verb"), I can
> say
> 
>     $ git reflog $verb <TAB>
> 
> and at that point, I am willing to wade thru list of 600+ refs.

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

end of thread, other threads:[~2011-10-04 19:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-25 10:42 [PATCH] git-completion: offer references for 'git reflog' Michael Schubert
2011-10-04  8:48 ` Michael Schubert
2011-10-04 17:05   ` Junio C Hamano
2011-10-04 19:34     ` Michael Schubert

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