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>
Rubén Justo committed
Mar 2, 2024 at 16:50 UTC
c689c38bc2dceac3f8fe975472f12c0dbe473537
2 files changed
+14
-1
contrib/completion/git-completion.bash
+10
@@ -2407,6 +2407,16 @@ _git_rebase ()
2407
_git_reflog ()
2408
{
2409
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
2420
2421
__git_complete_refs
2422
t/t9902-completion.sh
+4
-1
@@ -2626,7 +2626,10 @@ test_expect_success 'git reflog show' '
2626
shown Z
2627
EOF
2628
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="
2633
'
2634
2635
test_expect_success 'options with value' '