Skip to content

Commit

Permalink
bash: support 'git notes' and its subcommands
Browse files Browse the repository at this point in the history
... 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>
  • Loading branch information
SZEDER Gábor authored and Junio C Hamano committed Jan 28, 2010
1 parent 4ff61c2 commit 00f09d0
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions contrib/completion/git-completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 ;;
Expand Down

0 comments on commit 00f09d0

Please sign in to comment.