summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSZEDER Gábor <szeder@ira.uka.de>2010-01-28 01:05:55 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-01-28 22:22:37 (GMT)
commit00f09d0e4b1826ee0519ea64e919515032966450 (patch)
treeab7a6ba49b674aa87c93ad2dd04cf012ce184774
parent4ff61c21de519b4b3c9569b354fa5a3905b69c6a (diff)
downloadgit-00f09d0e4b1826ee0519ea64e919515032966450.zip
git-00f09d0e4b1826ee0519ea64e919515032966450.tar.gz
git-00f09d0e4b1826ee0519ea64e919515032966450.tar.bz2
bash: support 'git notes' and its subcommands
... 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 <szeder@ira.uka.de> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xcontrib/completion/git-completion.bash19
1 files changed, 19 insertions, 0 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 9651720..8b56c34 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 ;;