summaryrefslogtreecommitdiff
path: root/contrib/completion
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2006-11-04 18:57:44 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-11-05 01:17:46 (GMT)
commit67e78c3b8aeb44681b2d4ab2cf97145b7cc9a7a2 (patch)
tree99f3186abdcddcf9e84c5588169324611f397af6 /contrib/completion
parentdfb960920d4953066cb0cdf3cb6dd8a5a8d9cf14 (diff)
downloadgit-67e78c3b8aeb44681b2d4ab2cf97145b7cc9a7a2.zip
git-67e78c3b8aeb44681b2d4ab2cf97145b7cc9a7a2.tar.gz
git-67e78c3b8aeb44681b2d4ab2cf97145b7cc9a7a2.tar.bz2
Added bash completion support for git-reset.
Completion for the --hard/--soft/--mixed modes of operation as well as a ref name for <commit-ish> can be very useful and save some fingers. 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-xcontrib/completion/git-completion.bash9
1 files changed, 9 insertions, 0 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index b7b8a43..a3fbb90 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -271,6 +271,13 @@ _git_push ()
esac
}
+_git_reset ()
+{
+ local cur="${COMP_WORDS[COMP_CWORD]}"
+ local opt="--mixed --hard --soft"
+ COMPREPLY=($(compgen -W "$opt $(__git_refs .)" -- "$cur"))
+}
+
_git_show ()
{
local cur="${COMP_WORDS[COMP_CWORD]}"
@@ -304,6 +311,7 @@ _git ()
ls-tree) _git_ls_tree ;;
pull) _git_pull ;;
push) _git_push ;;
+ reset) _git_reset ;;
show) _git_show ;;
show-branch) _git_log ;;
whatchanged) _git_log ;;
@@ -332,6 +340,7 @@ complete -o default -o nospace -F _git_ls_tree git-ls-tree
complete -o default -F _git_merge_base git-merge-base
complete -o default -o nospace -F _git_pull git-pull
complete -o default -o nospace -F _git_push git-push
+complete -o default -F _git_reset git-reset
complete -o default -F _git_show git-show
complete -o default -o nospace -F _git_log git-whatchanged