summaryrefslogtreecommitdiff
path: root/contrib/completion/git-completion.bash
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-05-08 06:59:32 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-08 06:59:32 (GMT)
commit79d92b113cc6b61112b8856eca78b8b97bbaca6a (patch)
tree26dcbea7aa65508a845347b64009328957f37864 /contrib/completion/git-completion.bash
parentc50f76aa9d40203650fe36107adbad42104f8cf6 (diff)
parentdf70b190bdd2add42a906819f9d41dbf91cf0809 (diff)
downloadgit-79d92b113cc6b61112b8856eca78b8b97bbaca6a.zip
git-79d92b113cc6b61112b8856eca78b8b97bbaca6a.tar.gz
git-79d92b113cc6b61112b8856eca78b8b97bbaca6a.tar.bz2
Merge branch 'tg/demote-stash-save-in-completion'
The command line completion (in contrib/) has been taught that "git stash save" has been deprecated ("git stash push" is the preferred spelling in the new world) and does not offer it as a possible completion candidate when "git stash push" can be. * tg/demote-stash-save-in-completion: completion: make stash -p and alias for stash push -p completion: stop showing 'save' for stash by default
Diffstat (limited to 'contrib/completion/git-completion.bash')
-rw-r--r--contrib/completion/git-completion.bash12
1 files changed, 10 insertions, 2 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 159e640..46047e1 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -2775,13 +2775,21 @@ _git_show_branch ()
_git_stash ()
{
local save_opts='--all --keep-index --no-keep-index --quiet --patch --include-untracked'
- local subcommands='push save list show apply clear drop pop create branch'
- local subcommand="$(__git_find_on_cmdline "$subcommands")"
+ local subcommands='push list show apply clear drop pop create branch'
+ local subcommand="$(__git_find_on_cmdline "$subcommands save")"
+ if [ -n "$(__git_find_on_cmdline "-p")" ]; then
+ subcommand="push"
+ fi
if [ -z "$subcommand" ]; then
case "$cur" in
--*)
__gitcomp "$save_opts"
;;
+ sa*)
+ if [ -z "$(__git_find_on_cmdline "$save_opts")" ]; then
+ __gitcomp "save"
+ fi
+ ;;
*)
if [ -z "$(__git_find_on_cmdline "$save_opts")" ]; then
__gitcomp "$subcommands"