diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2006-11-28 12:12:08 -0500 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-11-28 15:48:52 -0800 |
commit | 4548e855e4600a0f76329cf4f0dd9e8d17d66b08 (patch) | |
tree | 2dc304b2b32f8e03d6ce6cd33bb6eca141c92cc1 /contrib/completion | |
parent | git-svn: fix output reporting from the delta fetcher (diff) | |
download | tgif-4548e855e4600a0f76329cf4f0dd9e8d17d66b08.tar.xz |
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>
Diffstat (limited to 'contrib/completion')
-rwxr-xr-x | contrib/completion/git-completion.bash | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index d8ae4d7886..be978cf3d3 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -398,6 +398,20 @@ _git_cherry_pick () esac } +_git_commit () +{ + local cur="${COMP_WORDS[COMP_CWORD]}" + case "$cur" in + --*) + COMPREPLY=($(compgen -W " + --all --author= --signoff --verify --no-verify + --edit --amend --include --only + " -- "$cur")) + return + esac + COMPREPLY=() +} + _git_diff () { __git_complete_file @@ -768,6 +782,7 @@ _git () cat-file) _git_cat_file ;; checkout) _git_checkout ;; cherry-pick) _git_cherry_pick ;; + commit) _git_commit ;; diff) _git_diff ;; diff-tree) _git_diff_tree ;; fetch) _git_fetch ;; @@ -804,6 +819,7 @@ complete -o default -F _git_branch git-branch complete -o default -o nospace -F _git_cat_file git-cat-file complete -o default -F _git_checkout git-checkout complete -o default -F _git_cherry_pick git-cherry-pick +complete -o default -F _git_commit git-commit complete -o default -o nospace -F _git_diff git-diff complete -o default -F _git_diff_tree git-diff-tree complete -o default -o nospace -F _git_fetch git-fetch |