Skip to content

Commit 79d92b1

Browse files
committed
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
2 parents c50f76a + df70b19 commit 79d92b1

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

contrib/completion/git-completion.bash

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2775,13 +2775,21 @@ _git_show_branch ()
27752775
_git_stash ()
27762776
{
27772777
local save_opts='--all --keep-index --no-keep-index --quiet --patch --include-untracked'
2778-
local subcommands='push save list show apply clear drop pop create branch'
2779-
local subcommand="$(__git_find_on_cmdline "$subcommands")"
2778+
local subcommands='push list show apply clear drop pop create branch'
2779+
local subcommand="$(__git_find_on_cmdline "$subcommands save")"
2780+
if [ -n "$(__git_find_on_cmdline "-p")" ]; then
2781+
subcommand="push"
2782+
fi
27802783
if [ -z "$subcommand" ]; then
27812784
case "$cur" in
27822785
--*)
27832786
__gitcomp "$save_opts"
27842787
;;
2788+
sa*)
2789+
if [ -z "$(__git_find_on_cmdline "$save_opts")" ]; then
2790+
__gitcomp "save"
2791+
fi
2792+
;;
27852793
*)
27862794
if [ -z "$(__git_find_on_cmdline "$save_opts")" ]; then
27872795
__gitcomp "$subcommands"

0 commit comments

Comments
 (0)