Skip to content

Commit 6672950

Browse files
szedergitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8024ea6 commit 6672950

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

contrib/completion/git-completion.bash

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,10 @@ __git_aliased_command ()
626626
config --get "alias.$1")
627627
for word in $cmdline; do
628628
case "$word" in
629+
\!gitk|gitk)
630+
echo "gitk"
631+
return
632+
;;
629633
\!*) : shell command alias ;;
630634
-*) : option ;;
631635
*=*) : setting env ;;
@@ -1087,6 +1091,11 @@ _git_gc ()
10871091
COMPREPLY=()
10881092
}
10891093

1094+
_git_gitk ()
1095+
{
1096+
_gitk
1097+
}
1098+
10901099
_git_grep ()
10911100
{
10921101
__git_has_doubledash && return

0 commit comments

Comments
 (0)