Re: [PATCH v2 1/3] completion: complete "unstuck" `git push --recurse-submodules`
- From
John Keeping <john@keeping.me.uk>
- Date
- Jul 22, 2014, 20:57 UTC
- Message-ID
- <20140722205730.GD26927@serenity.lan>
- In-Reply-To
- <xmqqr41df8hu.fsf@gitster.dls.corp.google.com>
On Tue, Jul 22, 2014 at 01:23:25PM -0700, Junio C Hamano wrote:
Show 35 quoted lines
> John Keeping <john@keeping.me.uk> writes:
>
> > Since the argument to `--recurse-submodules` is mandatory, it does not
> > need to be stuck to the option with `=`.
> >
> > Signed-off-by: John Keeping <john@keeping.me.uk>
> > ---
> > Change since v1:
> > - Fix typo --recurse{_ => -}submodules
> > - Dropped previous patch 1/4 adding ";;" at the end of the "--repo" case
> >
> > contrib/completion/git-completion.bash | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> > index 7a6e1d7..bed3665 100644
> > --- a/contrib/completion/git-completion.bash
> > +++ b/contrib/completion/git-completion.bash
> > @@ -1624,6 +1624,10 @@ __git_push_recurse_submodules="check on-demand"
> > _git_push ()
> > {
> > case "$prev" in
> > + --recurse-submodules)
> > + __gitcomp "$__git_push_recurse_submodules"
> > + return
> > + ;;
> > --repo)
> > __gitcomp_nl "$(__git_remotes)"
> > return
>
> If you mimick the order they are handled in the case on "$cur", it
> would also let us sneak in the missing-optional ";;" to case/esac to
> keep symmetry between the two ;-)
>
> In other words, like this, perhaps?Makes sense. I don't think I noted the order in the "$cur" case, I just put the new one in here so that they were sorted lexicographically.
Do you want me to re-roll with this change or can you replace the patch while applying?
Show 18 quoted lines
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash > index 019026e..b27f385 100644 > --- a/contrib/completion/git-completion.bash > +++ b/contrib/completion/git-completion.bash > @@ -1617,6 +1617,11 @@ _git_push () > --repo) > __gitcomp_nl "$(__git_remotes)" > return > + ;; > + --recurse-submodules) > + __gitcomp "$__git_push_recurse_submodules" > + return > + ;; > esac > case "$cur" in > --repo=*) > -- > 2.0.2-892-g223db29