@matheusbsbs / matheus-bagliano / commits / 00f09d0e4b
Fork 0

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>

SZEDER Gábor committed Jan 28, 2010 at 02:05 UTC 00f09d0e4b1826ee0519ea64e919515032966450
1 file changed +19
contrib/completion/git-completion.bash
+19
@@ -1306,6 +1306,24 @@ _git_name_rev ()
1306 __gitcomp "--tags --all --stdin"
1307 }
1308
1309 +_git_notes ()
1310 +{
1311 + local subcommands="edit show"
1312 + if [ -z "$(__git_find_on_cmdline "$subcommands")" ]; then
1313 + __gitcomp "$subcommands"
1314 + return
1315 + fi
1316 +
1317 + case "${COMP_WORDS[COMP_CWORD-1]}" in
1318 + -m|-F)
1319 + COMPREPLY=()
1320 + ;;
1321 + *)
1322 + __gitcomp "$(__git_refs)"
1323 + ;;
1324 + esac
1325 +}
1326 +
1327 _git_pull ()
1328 {
1329 __git_complete_strategy && return
@@ -2218,6 +2236,7 @@ _git ()
2236 merge-base) _git_merge_base ;;
2237 mv) _git_mv ;;
2238 name-rev) _git_name_rev ;;
2239 + notes) _git_notes ;;
2240 pull) _git_pull ;;
2241 push) _git_push ;;
2242 rebase) _git_rebase ;;