git-completion.bash: provide completion for 'show-branch'
It previously used the same as 'log', but the options are quite different and the arguments must be single refs (or globs). Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Thomas Rast committed
Jul 23, 2008 at 23:36 UTC
2ca880fe54660869bc93a2302efced9ab64511d9
1 file changed
+17
-1
contrib/completion/git-completion.bash
+17
-1
@@ -1224,6 +1224,22 @@ _git_show ()
1224
__git_complete_file
1225
}
1226
1227
+_git_show_branch ()
1228
+{
1229
+ local cur="${COMP_WORDS[COMP_CWORD]}"
1230
+ case "$cur" in
1231
+ --*)
1232
+ __gitcomp "
1233
+ --all --remotes --topo-order --current --more=
1234
+ --list --independent --merge-base --no-name
1235
+ --sha1-name --topics --reflog
1236
+ "
1237
+ return
1238
+ ;;
1239
+ esac
1240
+ __git_complete_revlist
1241
+}
1242
+
1243
_git_stash ()
1244
{
1245
local subcommands='save list show apply clear drop pop create'
@@ -1443,7 +1459,7 @@ _git ()
1459
send-email) _git_send_email ;;
1460
shortlog) _git_shortlog ;;
1461
show) _git_show ;;
1446
- show-branch) _git_log ;;
1462
+ show-branch) _git_show_branch ;;
1463
stash) _git_stash ;;
1464
submodule) _git_submodule ;;
1465
svn) _git_svn ;;