@matheusbsbs / matheus-bagliano / commits / 6672950945
Fork 0

bash: completion for gitk aliases

gitk aliases either start with "!gitk", or look something like "!sh -c FOO=bar gitk", IOW they contain the "gitk" word. With this patch the completion script will recognize these cases and will offer gitk's options. Just like the earlier change improving on aliased command recognition, this change can also be fooled easily by some complex aliases, but users of such aliases could remedy it with custom completion functions. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

SZEDER Gábor committed Feb 23, 2010 at 22:03 UTC 66729509457f11b15216c3cdfdbb2f34eddfbe89
1 file changed +9
contrib/completion/git-completion.bash
+9
@@ -626,6 +626,10 @@ __git_aliased_command ()
626 config --get "alias.$1")
627 for word in $cmdline; do
628 case "$word" in
629 + \!gitk|gitk)
630 + echo "gitk"
631 + return
632 + ;;
633 \!*) : shell command alias ;;
634 -*) : option ;;
635 *=*) : setting env ;;
@@ -1087,6 +1091,11 @@ _git_gc ()
1091 COMPREPLY=()
1092 }
1093
1094 +_git_gitk ()
1095 +{
1096 + _gitk
1097 +}
1098 +
1099 _git_grep ()
1100 {
1101 __git_has_doubledash && return