Re: [PATCH 3/4] completion: reflog with implicit "show"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 20, 2024 at 17:46:20 -0800, Junio C Hamano wrote:

>     $ git reflog sho<TAB>
>     shot show
> 
> That is what I would expect.    

Thank you for responding.

Of course that's the logical expectation.

However I'm not sure if it is sensible to offer completion for
sub-commands mixed with branch names.

Furthermore, I am also worried that such an approach implies making the
user pay, probably unnecessarily many times, for __git_complete_refs in
cases such as:

    $ git reflog <TAB><TAB>  ;# the user may be just exploring the sub-commands
    $ git reflog s<TAB>      ;# the user may be lazy and just want "show "
    $ git reflog show<TAB>   ;# likewise, to complete the SP
    $ git reflog expir<TAB>  ;# how often a expir... branch is expected here?

The experienced user, if not most users, should be intuitive enough to
circumvent the corner cases:

    $ git reflog <TAB><TAB>
    delete expire show
    ...
    $ git reflog s<TAB>
    ...
    $ git reflog show s<TAB>
    ...
    $ git reflog show shot

This is why I choose to fallback to __git_complete_ref only when no
other option is available.

If you think, or anyone else, that these concerns don't make sense, I'm
open to make it work as you described.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux