Skip to content

Commit c689c38

Browse files
rjustogitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 85452a1 commit c689c38

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

contrib/completion/git-completion.bash

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2407,6 +2407,16 @@ _git_rebase ()
24072407
_git_reflog ()
24082408
{
24092409
local subcommands="show delete expire"
2410+
local subcommand="$(__git_find_subcommand "$subcommands" "show")"
2411+
2412+
case "$subcommand,$cur" in
2413+
show,--*)
2414+
__gitcomp "
2415+
$__git_log_common_options
2416+
"
2417+
return
2418+
;;
2419+
esac
24102420

24112421
__git_complete_refs
24122422

t/t9902-completion.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2626,7 +2626,10 @@ test_expect_success 'git reflog show' '
26262626
shown Z
26272627
EOF
26282628
test_completion "git reflog show sho" "shown " &&
2629-
test_completion "git reflog shown sho" "shown "
2629+
test_completion "git reflog shown sho" "shown " &&
2630+
test_completion "git reflog --unt" "--until=" &&
2631+
test_completion "git reflog show --unt" "--until=" &&
2632+
test_completion "git reflog shown --unt" "--until="
26302633
'
26312634

26322635
test_expect_success 'options with value' '

0 commit comments

Comments
 (0)