mbox series

[0/4] completion for git-reflog show

Message ID 98daf977-dbad-4d3b-a293-6a769895088f@gmail.com (mailing list archive)
Headers show
Series completion for git-reflog show | expand

Message

Rubén Justo Jan. 26, 2024, 12:46 p.m. UTC
When no subcommand is specified to "reflog" we assume "show" [1]:

    $ git reflog -h
    usage: git reflog [show] [<log-options>] [<ref>]
    ...

We are not completing correctly this implicit uses of "show":

With ...

    $ git checkout -b default

... we are not completing "default":

    $ git reflog def<TAB><TAB>

And we are incorrectly returning the "subcommands" when:

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

This series fixes this and also adds completion for <log-options> in
"reflog show", so that the user can easily discover uses like:

   $ git reflog --since=1.day.ago

  1. cf39f54efc (git reflog show, 2007-02-08)

Rubén Justo (4):
  completion: introduce __gitcomp_subcommand
  completion: introduce __git_find_subcommand
  completion: reflog with implicit "show"
  completion: reflog show <log-options>

 contrib/completion/git-completion.bash | 63 +++++++++++++++++++++++---
 t/t9902-completion.sh                  | 11 +++++
 2 files changed, 68 insertions(+), 6 deletions(-)