From 00f09d0e4b1826ee0519ea64e919515032966450 Mon Sep 17 00:00:00 2001 From: =?utf8?q?SZEDER=20G=C3=A1bor?= Date: Thu, 28 Jan 2010 02:05:55 +0100 Subject: [PATCH] bash: support 'git notes' and its subcommands MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit ... and it will offer refs unless after -m or -F, because these two options require a non-ref argument. Signed-off-by: SZEDER Gábor Acked-by: Shawn O. Pearce Signed-off-by: Junio C Hamano --- contrib/completion/git-completion.bash | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 965172041..8b56c34bd 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -1306,6 +1306,24 @@ _git_name_rev () __gitcomp "--tags --all --stdin" } +_git_notes () +{ + local subcommands="edit show" + if [ -z "$(__git_find_on_cmdline "$subcommands")" ]; then + __gitcomp "$subcommands" + return + fi + + case "${COMP_WORDS[COMP_CWORD-1]}" in + -m|-F) + COMPREPLY=() + ;; + *) + __gitcomp "$(__git_refs)" + ;; + esac +} + _git_pull () { __git_complete_strategy && return @@ -2218,6 +2236,7 @@ _git () merge-base) _git_merge_base ;; mv) _git_mv ;; name-rev) _git_name_rev ;; + notes) _git_notes ;; pull) _git_pull ;; push) _git_push ;; rebase) _git_rebase ;; -- 2.30.2