completion: reflog show <log-options>

Let's add completion for <log-options> in "reflog show" so that the user
can easily discover uses like:

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

Signed-off-by: Rubén Justo <rjusto@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Rubén Justo 2024-03-02 16:50:47 +01:00 committed by Junio C Hamano
parent 85452a1d4b
commit c689c38bc2
2 changed files with 14 additions and 1 deletions

View File

@ -2407,6 +2407,16 @@ _git_rebase ()
_git_reflog ()
{
local subcommands="show delete expire"
local subcommand="$(__git_find_subcommand "$subcommands" "show")"

case "$subcommand,$cur" in
show,--*)
__gitcomp "
$__git_log_common_options
"
return
;;
esac

__git_complete_refs


View File

@ -2626,7 +2626,10 @@ test_expect_success 'git reflog show' '
shown Z
EOF
test_completion "git reflog show sho" "shown " &&
test_completion "git reflog shown sho" "shown "
test_completion "git reflog shown sho" "shown " &&
test_completion "git reflog --unt" "--until=" &&
test_completion "git reflog show --unt" "--until=" &&
test_completion "git reflog shown --unt" "--until="
'

test_expect_success 'options with value' '