@matheusbsbs / matheus-bagliano / commits / 4548e855e4
Fork 0

Teach bash how to complete long options for git-commit.

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

Shawn O. Pearce committed Nov 28, 2006 at 12:12 UTC 4548e855e4600a0f76329cf4f0dd9e8d17d66b08
1 file changed +16
contrib/completion/git-completion.bash
+16
@@ -398,6 +398,20 @@ _git_cherry_pick ()
398 esac
399 }
400
401 +_git_commit ()
402 +{
403 + local cur="${COMP_WORDS[COMP_CWORD]}"
404 + case "$cur" in
405 + --*)
406 + COMPREPLY=($(compgen -W "
407 + --all --author= --signoff --verify --no-verify
408 + --edit --amend --include --only
409 + " -- "$cur"))
410 + return
411 + esac
412 + COMPREPLY=()
413 +}
414 +
415 _git_diff ()
416 {
417 __git_complete_file
@@ -768,6 +782,7 @@ _git ()
782 cat-file) _git_cat_file ;;
783 checkout) _git_checkout ;;
784 cherry-pick) _git_cherry_pick ;;
785 + commit) _git_commit ;;
786 diff) _git_diff ;;
787 diff-tree) _git_diff_tree ;;
788 fetch) _git_fetch ;;
@@ -804,6 +819,7 @@ complete -o default -F _git_branch git-branch
819 complete -o default -o nospace -F _git_cat_file git-cat-file
820 complete -o default -F _git_checkout git-checkout
821 complete -o default -F _git_cherry_pick git-cherry-pick
822 +complete -o default -F _git_commit git-commit
823 complete -o default -o nospace -F _git_diff git-diff
824 complete -o default -F _git_diff_tree git-diff-tree
825 complete -o default -o nospace -F _git_fetch git-fetch