public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Paul Wagland <paul@kungfoocoder•org>
Cc: git@vger•kernel.org
Subject: Re: [PATCH 2/2] Fix up the arguments for git stash.
Date: Mon, 25 Jan 2016 15:21:27 -0800	[thread overview]
Message-ID: <xmqqio2hdz48.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20160123013049.GB28197@wagland.net> (Paul Wagland's message of "Sat, 23 Jan 2016 02:30:50 +0100")

Paul Wagland <paul@kungfoocoder•org> writes:

> Signed-off-by: Paul Wagland <paul@kungfoocoder•org>
> ---

This needs a better explanation than just "Fix up" in the title.
What is broken in the current behaviour and what is the more desired
behaviour?

Thanks.

>  contrib/completion/git-completion.bash | 17 ++++++++++++++---
>  1 file changed, 14 insertions(+), 3 deletions(-)
>
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index 63754bc..043d5bb 100644
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -2382,7 +2382,7 @@ _git_show_branch ()
>  
>  _git_stash ()
>  {
> -	local save_opts='--keep-index --no-keep-index --quiet --patch'
> +	local save_opts='--all --keep-index --no-keep-index --quiet --patch --include-untracked'
>  	local subcommands='save list show apply clear drop pop create branch'
>  	local subcommand="$(__git_find_on_cmdline "$subcommands")"
>  	if [ -z "$subcommand" ]; then
> @@ -2404,9 +2404,20 @@ _git_stash ()
>  		apply,--*|pop,--*)
>  			__gitcomp "--index --quiet"
>  			;;
> -		show,--*|drop,--*|branch,--*)
> +		drop,--*)
> +			__gitcomp "--quiet"
>  			;;
> -		show,*|apply,*|drop,*|pop,*|branch,*)
> +		show,--*|branch,--*)
> +			;;
> +		branch,*)
> +			if [ $cword -eq 3 ]; then
> +			__gitcomp_nl "$(__git_refs)";
> +			else
> +				__gitcomp_nl "$(git --git-dir="$(__gitdir)" stash list \
> +						| sed -n -e 's/:.*//p')"
> +			fi
> +			;;
> +		show,*|apply,*|drop,*|pop,*)
>  			__gitcomp_nl "$(git --git-dir="$(__gitdir)" stash list \
>  					| sed -n -e 's/:.*//p')"
>  			;;

  reply	other threads:[~2016-01-25 23:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-23  1:23 [PATCH 0/2] Update BASH completions Paul Wagland
2016-01-23  1:25 ` PATCH 1/2] Update the flags for git show-branch Paul Wagland
2016-01-25 23:17   ` Junio C Hamano
2016-01-23  1:30 ` [PATCH 2/2] Fix up the arguments for git stash Paul Wagland
2016-01-25 23:21   ` Junio C Hamano [this message]
2016-01-26  6:21     ` Paul Wagland
2016-01-26  9:34 ` [PATCH v2 0/2] Update BASH completions Paul Wagland
2016-01-26  9:36   ` [PATCH v2 1/2] completion: complete show-branch "--date-order" Paul Wagland
2016-01-26  9:37   ` [PATCH v2 2/4] completion: update completion arguments for stash Paul Wagland
2016-02-22 13:02     ` [PATCH] completion: fix mis-indentation in _git_stash() SZEDER Gábor

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=xmqqio2hdz48.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=paul@kungfoocoder$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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