@matheusbsbs / matheus-bagliano / commits / 1273231ee9
Fork 0

Teach bash how to complete git-cherry-pick.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>

Shawn O. Pearce committed Nov 27, 2006 at 03:41 UTC 1273231ee9c7a576a3654d8f2ba77267393564ab
1 file changed +17
contrib/completion/git-completion.bash
+17
@@ -269,6 +269,21 @@ _git_checkout ()
269 COMPREPLY=($(compgen -W "-l -b $(__git_refs)" -- "$cur"))
270 }
271
272 +_git_cherry_pick ()
273 +{
274 + local cur="${COMP_WORDS[COMP_CWORD]}"
275 + case "$cur" in
276 + --*)
277 + COMPREPLY=($(compgen -W "
278 + --edit --no-commit
279 + " -- "$cur"))
280 + ;;
281 + *)
282 + COMPREPLY=($(compgen -W "$(__git_refs)" -- "$cur"))
283 + ;;
284 + esac
285 +}
286 +
287 _git_diff ()
288 {
289 __git_complete_file
@@ -472,6 +487,7 @@ _git ()
487 branch) _git_branch ;;
488 cat-file) _git_cat_file ;;
489 checkout) _git_checkout ;;
490 + cherry-pick) _git_cherry_pick ;;
491 diff) _git_diff ;;
492 diff-tree) _git_diff_tree ;;
493 fetch) _git_fetch ;;
@@ -503,6 +519,7 @@ complete -o default -F _gitk gitk
519 complete -o default -F _git_branch git-branch
520 complete -o default -o nospace -F _git_cat_file git-cat-file
521 complete -o default -F _git_checkout git-checkout
522 +complete -o default -F _git_cherry_pick git-cherry-pick
523 complete -o default -o nospace -F _git_diff git-diff
524 complete -o default -F _git_diff_tree git-diff-tree
525 complete -o default -o nospace -F _git_fetch git-fetch