Browse Source

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
maint
Junio C Hamano 7 years ago
parent
commit
79d92b113c
  1. 12
      contrib/completion/git-completion.bash

12
contrib/completion/git-completion.bash

@ -2775,13 +2775,21 @@ _git_show_branch () @@ -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"

Loading…
Cancel
Save