summaryrefslogtreecommitdiff
path: root/contrib/completion/git-completion.bash
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2018-05-08 15:59:32 +0900
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-05-08 15:59:32 +0900
commit79d92b113cc6b61112b8856eca78b8b97bbaca6a (patch)
tree26dcbea7aa65508a845347b64009328957f37864 /contrib/completion/git-completion.bash
parentMerge branch 'sa/send-email-dedup-some-headers' (diff)
parentcompletion: make stash -p and alias for stash push -p (diff)
downloadtgif-79d92b113cc6b61112b8856eca78b8b97bbaca6a.tar.xz
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 159e6407df..46047e17ec 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"