Re: [PATCH 3/4] completion: reflog with implicit "show"
- From
Rubén Justo <rjusto@gmail.com>
- Date
- Feb 21, 2024, 18:06 UTC
- Message-ID
- <abe1c96d-48f7-4355-8688-e1fb05c67448@gmail.com>
- In-Reply-To
- <xmqqwmqyr3mb.fsf@gitster.g>
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 shotThis 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.