completion: add stash import, export

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>

D. Ben Knoble committed Feb 7, 2026 at 16:59 UTC bfc1b34859c973127cdef0cfba537c25ee39f763
1 file changed +8 -2
contrib/completion/git-completion.bash
+8 -2
@@ -3465,7 +3465,7 @@ _git_sparse_checkout ()
3465
3466 _git_stash ()
3467 {
3468 - local subcommands='push list show apply clear drop pop create branch'
3468 + local subcommands='push list show apply clear drop pop create branch import export'
3469 local subcommand="$(__git_find_on_cmdline "$subcommands save")"
3470
3471 if [ -z "$subcommand" ]; then
@@ -3491,6 +3491,9 @@ _git_stash ()
3491 show,--*)
3492 __gitcomp_builtin stash_show "$__git_diff_common_options"
3493 ;;
3494 + export,--*)
3495 + __gitcomp_builtin stash_export "--print --to-ref"
3496 + ;;
3497 *,--*)
3498 __gitcomp_builtin "stash_$subcommand"
3499 ;;
@@ -3502,7 +3505,10 @@ _git_stash ()
3505 | sed -n -e 's/:.*//p')"
3506 fi
3507 ;;
3505 - show,*|apply,*|drop,*|pop,*)
3508 + import,*)
3509 + __git_complete_refs
3510 + ;;
3511 + show,*|apply,*|drop,*|pop,*|export,*)
3512 __gitcomp_nl "$(__git stash list \
3513 | sed -n -e 's/:.*//p')"
3514 ;;