Skip to content

Commit 00f09d0

Browse files
szedergitster
authored andcommitted
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 <[email protected]> Acked-by: Shawn O. Pearce <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4ff61c2 commit 00f09d0

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

contrib/completion/git-completion.bash

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,6 +1306,24 @@ _git_name_rev ()
13061306
__gitcomp "--tags --all --stdin"
13071307
}
13081308

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+
13091327
_git_pull ()
13101328
{
13111329
__git_complete_strategy && return
@@ -2218,6 +2236,7 @@ _git ()
22182236
merge-base) _git_merge_base ;;
22192237
mv) _git_mv ;;
22202238
name-rev) _git_name_rev ;;
2239+
notes) _git_notes ;;
22212240
pull) _git_pull ;;
22222241
push) _git_push ;;
22232242
rebase) _git_rebase ;;

0 commit comments

Comments
 (0)