Skip to content

Commit d8a9fea

Browse files
spearceJunio C Hamano
authored andcommitted
bash: Support completion on git-cherry.
I just realized I did not support ref name completion for git-cherry. This tool is just too useful to contributors who submit patches upstream by email; completion support for it is very handy. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent ea81fcc commit d8a9fea

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

contrib/completion/git-completion.bash

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,11 @@ _git_checkout ()
415415
__gitcomp "$(__git_refs)"
416416
}
417417

418+
_git_cherry ()
419+
{
420+
__gitcomp "$(__git_refs)"
421+
}
422+
418423
_git_cherry_pick ()
419424
{
420425
local cur="${COMP_WORDS[COMP_CWORD]}"
@@ -867,6 +872,7 @@ _git ()
867872
apply) _git_apply ;;
868873
branch) _git_branch ;;
869874
checkout) _git_checkout ;;
875+
cherry) _git_cherry ;;
870876
cherry-pick) _git_cherry_pick ;;
871877
commit) _git_commit ;;
872878
config) _git_config ;;
@@ -909,6 +915,7 @@ complete -o default -o nospace -F _git_am git-am
909915
complete -o default -o nospace -F _git_apply git-apply
910916
complete -o default -o nospace -F _git_branch git-branch
911917
complete -o default -o nospace -F _git_checkout git-checkout
918+
complete -o default -o nospace -F _git_cherry git-cherry
912919
complete -o default -o nospace -F _git_cherry_pick git-cherry-pick
913920
complete -o default -o nospace -F _git_commit git-commit
914921
complete -o default -o nospace -F _git_diff git-diff
@@ -939,6 +946,7 @@ complete -o default -o nospace -F _git_add git-add.exe
939946
complete -o default -o nospace -F _git_apply git-apply.exe
940947
complete -o default -o nospace -F _git git.exe
941948
complete -o default -o nospace -F _git_branch git-branch.exe
949+
complete -o default -o nospace -F _git_cherry git-cherry.exe
942950
complete -o default -o nospace -F _git_diff git-diff.exe
943951
complete -o default -o nospace -F _git_diff_tree git-diff-tree.exe
944952
complete -o default -o nospace -F _git_format_patch git-format-patch.exe

0 commit comments

Comments
 (0)