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 <szeder@ira.uka.de> Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tay Ray Chuan committed
Dec 16, 2010 at 14:56 UTC
057f327972e7016703317e65e7af144a8e244d0a
1 file changed
+12
-1
contrib/completion/git-completion.bash
+12
-1
@@ -735,7 +735,6 @@ __git_list_porcelain_commands ()
735
quiltimport) : import;;
736
read-tree) : plumbing;;
737
receive-pack) : plumbing;;
738
- reflog) : plumbing;;
738
remote-*) : transport;;
739
repo-config) : deprecated;;
740
rerere) : plumbing;;
@@ -1632,6 +1631,18 @@ _git_rebase ()
1631
__gitcomp "$(__git_refs)"
1632
}
1633
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
+
1646
__git_send_email_confirm_options="always never auto cc compose"
1647
__git_send_email_suppresscc_options="author self cc bodycc sob cccmd body all"
1648