git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] completion: add stash import, export

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 8, 2026, 01:33 UTC
Message-ID
<xmqqpl6g9fyu.fsf@gitster.g>
In-Reply-To
<20260207215924.28863-1-ben.knoble+github@gmail.com>
"D. Ben Knoble" <ben.knoble+github@gmail.com> writes:
Show 15 quoted lines
> 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.
Show 24 quoted lines
> @@ -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
Previous: D. Ben Knoble
Message 2 of 2 in “completion: add stash import, export”
  1. completion: add stash import, exportD. Ben Knoble, Feb 7, 2026
  2. Junio C HamanoFeb 8, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.