Skip to content

Commit

Permalink
bash: completion for gitk aliases
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
SZEDER Gábor authored and Junio C Hamano committed Feb 24, 2010
1 parent 8024ea6 commit 6672950
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions contrib/completion/git-completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,10 @@ __git_aliased_command ()
config --get "alias.$1")
for word in $cmdline; do
case "$word" in
\!gitk|gitk)
echo "gitk"
return
;;
\!*) : shell command alias ;;
-*) : option ;;
*=*) : setting env ;;
Expand Down Expand Up @@ -1087,6 +1091,11 @@ _git_gc ()
COMPREPLY=()
}

_git_gitk ()
{
_gitk
}

_git_grep ()
{
__git_has_doubledash && return
Expand Down

0 comments on commit 6672950

Please sign in to comment.