Re: [PATCH 2/2] Fix up the arguments for git stash.
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 25, 2016, 23:21 UTC
- Message-ID
- <xmqqio2hdz48.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20160123013049.GB28197@wagland.net>
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.
Show 39 quoted lines
> 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')"
> ;;