diff options
author | Thomas Gummerer <t.gummerer@gmail.com> | 2018-04-20 01:25:14 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-04-20 03:39:50 +0200 |
commit | df70b190bdd2add42a906819f9d41dbf91cf0809 (patch) | |
tree | 95c8e3024dcee254464fa77d4e3a3caa62ba7fa9 /contrib/completion/git-completion.bash | |
parent | completion: stop showing 'save' for stash by default (diff) | |
download | git-df70b190bdd2add42a906819f9d41dbf91cf0809.tar.xz git-df70b190bdd2add42a906819f9d41dbf91cf0809.zip |
completion: make stash -p and alias for stash push -p
We define 'git stash -p' as an alias for 'git stash push -p' in the
manpage. Do the same in the completion script, so all options that
can be given to 'git stash push' are being completed when the user is
using 'git stash -p --<tab>'. Currently the only additional option
the user will get is '--message', but there may be more in the future.
Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to '')
-rw-r--r-- | contrib/completion/git-completion.bash | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 9a95b3b7b1..adb6516b6d 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -2776,6 +2776,9 @@ _git_stash () local save_opts='--all --keep-index --no-keep-index --quiet --patch --include-untracked' 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 --*) |