From 66729509457f11b15216c3cdfdbb2f34eddfbe89 Mon Sep 17 00:00:00 2001 From: =?utf8?q?SZEDER=20G=C3=A1bor?= Date: Tue, 23 Feb 2010 22:03:00 +0100 Subject: [PATCH] bash: completion for gitk aliases MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Junio C Hamano --- contrib/completion/git-completion.bash | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 8593fd707..3029f160b 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -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 ;; @@ -1087,6 +1091,11 @@ _git_gc () COMPREPLY=() } +_git_gitk () +{ + _gitk +} + _git_grep () { __git_has_doubledash && return -- 2.26.2