summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorLee Marlow <lee.marlow@gmail.com>2008-08-04 23:50:35 -0600
committerJunio C Hamano <gitster@pobox.com>2008-08-05 21:21:19 -0700
commit95d43780cff575cfffeea881464c77f84f8d7244 (patch)
tree555b0868051fee70f252193606e8638eeb701851 /contrib
parenta6c2be244f45432617944e684156556482fb11b6 (diff)
downloadgit-95d43780cff575cfffeea881464c77f84f8d7244.tar.gz
bash completion: More completions for 'git stash'
Add branch subcommand to completions and USAGE for git-stash.sh. Complete stash names for show, apply, drop, pop, and branch. Add "--index" long option for apply. Signed-off-by: Lee Marlow <lee.marlow@gmail.com> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/completion/git-completion.bash12
1 files changed, 11 insertions, 1 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 265842712e..49a03c314e 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1371,7 +1371,7 @@ _git_show_branch ()
_git_stash ()
{
- local subcommands='save list show apply clear drop pop create'
+ local subcommands='save list show apply clear drop pop create branch'
local subcommand="$(__git_find_subcommand "$subcommands")"
if [ -z "$subcommand" ]; then
__gitcomp "$subcommands"
@@ -1381,6 +1381,16 @@ _git_stash ()
save,--*)
__gitcomp "--keep-index"
;;
+ apply,--*)
+ __gitcomp "--index"
+ ;;
+ show,--*|apply,--*|drop,--*|pop,--*|branch,--*)
+ COMPREPLY=()
+ ;;
+ show,*|apply,*|drop,*|pop,*|branch,*)
+ __gitcomp "$(git --git-dir="$(__gitdir)" stash list \
+ | sed -n -e 's/:.*//p')"
+ ;;
*)
COMPREPLY=()
;;