From: Junio C Hamano <gitster@pobox.com>
To: "D. Ben Knoble" <ben.knoble+github@gmail.com>
Cc: git@vger.kernel.org, Denton Liu <liu.denton@gmail.com>
Subject: Re: [PATCH] completion: add stash import, export
Date: Sat, 07 Feb 2026 17:33:29 -0800 [thread overview]
Message-ID: <xmqqpl6g9fyu.fsf@gitster.g> (raw)
In-Reply-To: <20260207215924.28863-1-ben.knoble+github@gmail.com> (D. Ben Knoble's message of "Sat, 7 Feb 2026 16:59:16 -0500")
"D. Ben Knoble" <ben.knoble+github@gmail.com> writes:
> These newer commands lack completion; implement basic support for
> options and arguments.
>
> Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>
> ---
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index 538dff1ee5..a8e7c6ddbf 100644
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -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'
Makes sense, but in the longer term, we should devise a way to make
this script and parse-options infrastructure cooperate so that we do
not have to update it, just like options are completed using the
special "git cmd --git-completion-helper" option.
In any case, will apply. Thanks.
> @@ -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')"
> ;;
>
> base-commit: 2a3d6836805534f45cf545da7be25ce1c759c514
prev parent reply other threads:[~2026-02-08 1:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-07 21:59 [PATCH] completion: add stash import, export D. Ben Knoble
2026-02-08 1:33 ` Junio C Hamano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqpl6g9fyu.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=ben.knoble+github@gmail.com \
--cc=git@vger.kernel.org \
--cc=liu.denton@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox