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
This commit is contained in:
Junio C Hamano 2018-05-08 15:59:32 +09:00
Родитель c50f76aa9d df70b190bd
Коммит 79d92b113c
1 изменённых файлов: 10 добавлений и 2 удалений

Просмотреть файл

@ -2775,13 +2775,21 @@ _git_show_branch ()
_git_stash () _git_stash ()
{ {
local save_opts='--all --keep-index --no-keep-index --quiet --patch --include-untracked' 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 subcommands='push list show apply clear drop pop create branch'
local subcommand="$(__git_find_on_cmdline "$subcommands")" local subcommand="$(__git_find_on_cmdline "$subcommands save")"
if [ -n "$(__git_find_on_cmdline "-p")" ]; then
subcommand="push"
fi
if [ -z "$subcommand" ]; then if [ -z "$subcommand" ]; then
case "$cur" in case "$cur" in
--*) --*)
__gitcomp "$save_opts" __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 if [ -z "$(__git_find_on_cmdline "$save_opts")" ]; then
__gitcomp "$subcommands" __gitcomp "$subcommands"