Skip to content

Commit 057f327

Browse files
rctaygitster
authored andcommitted
bash completion: add basic support for git-reflog
"Promote" the reflog command out of plumbing, so that we now run completion for it. After all, it's listed under porcelain (ancillary), and we do run completion for those commands. Add basic completion for the three subcommands - show, expire, delete. Try completing refs for these too. Helped-by: SZEDER Gábor <[email protected]> Signed-off-by: Tay Ray Chuan <[email protected]> Reviewed-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1b97434 commit 057f327

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

contrib/completion/git-completion.bash

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,6 @@ __git_list_porcelain_commands ()
735735
quiltimport) : import;;
736736
read-tree) : plumbing;;
737737
receive-pack) : plumbing;;
738-
reflog) : plumbing;;
739738
remote-*) : transport;;
740739
repo-config) : deprecated;;
741740
rerere) : plumbing;;
@@ -1632,6 +1631,18 @@ _git_rebase ()
16321631
__gitcomp "$(__git_refs)"
16331632
}
16341633

1634+
_git_reflog ()
1635+
{
1636+
local subcommands="show delete expire"
1637+
local subcommand="$(__git_find_on_cmdline "$subcommands")"
1638+
1639+
if [ -z "$subcommand" ]; then
1640+
__gitcomp "$subcommands"
1641+
else
1642+
__gitcomp "$(__git_refs)"
1643+
fi
1644+
}
1645+
16351646
__git_send_email_confirm_options="always never auto cc compose"
16361647
__git_send_email_suppresscc_options="author self cc bodycc sob cccmd body all"
16371648

0 commit comments

Comments
 (0)