Skip to content

Commit 67e78c3

Browse files
spearceJunio C Hamano
authored andcommitted
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>
1 parent dfb9609 commit 67e78c3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

contrib/completion/git-completion.bash

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,13 @@ _git_push ()
271271
esac
272272
}
273273

274+
_git_reset ()
275+
{
276+
local cur="${COMP_WORDS[COMP_CWORD]}"
277+
local opt="--mixed --hard --soft"
278+
COMPREPLY=($(compgen -W "$opt $(__git_refs .)" -- "$cur"))
279+
}
280+
274281
_git_show ()
275282
{
276283
local cur="${COMP_WORDS[COMP_CWORD]}"
@@ -304,6 +311,7 @@ _git ()
304311
ls-tree) _git_ls_tree ;;
305312
pull) _git_pull ;;
306313
push) _git_push ;;
314+
reset) _git_reset ;;
307315
show) _git_show ;;
308316
show-branch) _git_log ;;
309317
whatchanged) _git_log ;;
@@ -332,6 +340,7 @@ complete -o default -o nospace -F _git_ls_tree git-ls-tree
332340
complete -o default -F _git_merge_base git-merge-base
333341
complete -o default -o nospace -F _git_pull git-pull
334342
complete -o default -o nospace -F _git_push git-push
343+
complete -o default -F _git_reset git-reset
335344
complete -o default -F _git_show git-show
336345
complete -o default -o nospace -F _git_log git-whatchanged
337346

0 commit comments

Comments
 (0)