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

Re: [PATCH] bash completion: allow git stash store options completion

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 13, 2015, 18:40 UTC
Message-ID
<xmqq7fwqed7b.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1421171612-12058-1-git-send-email-kuleshovmail@gmail.com>
Alexander Kuleshov <kuleshovmail@gmail.com> writes:
Show 5 quoted lines
> This patch adds bash completion for git stash 'store' subcommand
> which apperead at bd514cad (stash: introduce 'git stash store', 18 Jun 2013)
>
> Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
> ---

Hmph. The "create" and "store" subcommands are not end-user facing; they are meant to be used in scripts. I am not sure if we want to complete them in the first place. I know "create" already is in the list of completion candidates, but I wonder if adding "store" is making things worse.

I dunno.
Show 26 quoted lines
>  contrib/completion/git-completion.bash | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index c21190d..7578266 100644
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -2375,7 +2375,7 @@ _git_show_branch ()
>  _git_stash ()
>  {
>  	local save_opts='--keep-index --no-keep-index --quiet --patch'
> -	local subcommands='save list show apply clear drop pop create branch'
> +	local subcommands='save list show apply clear drop pop create branch store'
>  	local subcommand="$(__git_find_on_cmdline "$subcommands")"
>  	if [ -z "$subcommand" ]; then
>  		case "$cur" in
> @@ -2402,6 +2402,9 @@ _git_stash ()
>  			__gitcomp_nl "$(git --git-dir="$(__gitdir)" stash list \
>  					| sed -n -e 's/:.*//p')"
>  			;;
> +		store,--*)
> +			__gitcomp "--message --quiet"
> +			;;
>  		*)
>  			;;
>  		esac
Previous: Alexander KuleshovNext: brian m. carlson
Message 2 of 4 in “bash completion: allow git stash store options completion”
  1. bash completion: allow git stash store options completionAlexander Kuleshov, Jan 13, 2015
  2. Junio C HamanoJan 13, 2015
  3. brian m. carlsonJan 14, 2015
  4. Junio C HamanoJan 14, 2015

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.