Skip to content

Commit df70b19

Browse files
tgummerergitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0eb5a4f commit df70b19

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

contrib/completion/git-completion.bash

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2776,6 +2776,9 @@ _git_stash ()
27762776
local save_opts='--all --keep-index --no-keep-index --quiet --patch --include-untracked'
27772777
local subcommands='push list show apply clear drop pop create branch'
27782778
local subcommand="$(__git_find_on_cmdline "$subcommands save")"
2779+
if [ -n "$(__git_find_on_cmdline "-p")" ]; then
2780+
subcommand="push"
2781+
fi
27792782
if [ -z "$subcommand" ]; then
27802783
case "$cur" in
27812784
--*)

0 commit comments

Comments
 (0)