]> git.ipfire.org Git - thirdparty/git.git/commitdiff
completion: add stash import, export
authorD. Ben Knoble <ben.knoble+github@gmail.com>
Sat, 7 Feb 2026 21:59:16 +0000 (16:59 -0500)
committerJunio C Hamano <gitster@pobox.com>
Sun, 8 Feb 2026 01:27:56 +0000 (17:27 -0800)
These newer commands lack completion; implement basic support for
options and arguments.

Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-completion.bash

index 538dff1ee5cebee2e4a7a03db63c4766dd157259..a8e7c6ddbfb2b13659587ba7ab4adb7cf4c63127 100644 (file)
@@ -3465,7 +3465,7 @@ _git_sparse_checkout ()
 
 _git_stash ()
 {
-       local subcommands='push list show apply clear drop pop create branch'
+       local subcommands='push list show apply clear drop pop create branch import export'
        local subcommand="$(__git_find_on_cmdline "$subcommands save")"
 
        if [ -z "$subcommand" ]; then
@@ -3491,6 +3491,9 @@ _git_stash ()
        show,--*)
                __gitcomp_builtin stash_show "$__git_diff_common_options"
                ;;
+       export,--*)
+               __gitcomp_builtin stash_export "--print --to-ref"
+               ;;
        *,--*)
                __gitcomp_builtin "stash_$subcommand"
                ;;
@@ -3502,7 +3505,10 @@ _git_stash ()
                                        | sed -n -e 's/:.*//p')"
                fi
                ;;
-       show,*|apply,*|drop,*|pop,*)
+       import,*)
+               __git_complete_refs
+               ;;
+       show,*|apply,*|drop,*|pop,*|export,*)
                __gitcomp_nl "$(__git stash list \
                                | sed -n -e 's/:.*//p')"
                ;;