summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorPaul Wagland <paul@kungfoocoder.org>2016-01-26 09:37:19 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-01-26 18:37:11 (GMT)
commitd7d4ca87a9b44a3da5602714733adb6047f476c3 (patch)
treeb1bb2afe6c06cc9c601a39348e661e0dcf4601e5 /contrib
parent1b0b6dd0720572dcf90c264aeb91f96a017b0f25 (diff)
downloadgit-d7d4ca87a9b44a3da5602714733adb6047f476c3.zip
git-d7d4ca87a9b44a3da5602714733adb6047f476c3.tar.gz
git-d7d4ca87a9b44a3da5602714733adb6047f476c3.tar.bz2
completion: update completion arguments for stash
Add --all and --include-untracked to the git stash save completions. Add --quiet to the git stash drop completions. Update git stash branch so that the first argument expands out to the possible branch names, and the other arguments expand to the stash names. Signed-off-by: Paul Wagland <paul@kungfoocoder.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib')
-rw-r--r--contrib/completion/git-completion.bash17
1 files changed, 14 insertions, 3 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 6956807..07fa13b 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -2381,7 +2381,7 @@ _git_show_branch ()
_git_stash ()
{
- local save_opts='--keep-index --no-keep-index --quiet --patch'
+ local save_opts='--all --keep-index --no-keep-index --quiet --patch --include-untracked'
local subcommands='save list show apply clear drop pop create branch'
local subcommand="$(__git_find_on_cmdline "$subcommands")"
if [ -z "$subcommand" ]; then
@@ -2403,9 +2403,20 @@ _git_stash ()
apply,--*|pop,--*)
__gitcomp "--index --quiet"
;;
- show,--*|drop,--*|branch,--*)
+ drop,--*)
+ __gitcomp "--quiet"
;;
- show,*|apply,*|drop,*|pop,*|branch,*)
+ show,--*|branch,--*)
+ ;;
+ branch,*)
+ if [ $cword -eq 3 ]; then
+ __gitcomp_nl "$(__git_refs)";
+ else
+ __gitcomp_nl "$(git --git-dir="$(__gitdir)" stash list \
+ | sed -n -e 's/:.*//p')"
+ fi
+ ;;
+ show,*|apply,*|drop,*|pop,*)
__gitcomp_nl "$(git --git-dir="$(__gitdir)" stash list \
| sed -n -e 's/:.*//p')"
;;