From: "SZEDER Gábor" <szeder@ira.uka.de>
To: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Cc: Stefan Haller <lists@haller-berlin.de>, git@vger.kernel.org
Subject: Re: Zsh completion regression
Date: Sat, 14 Jan 2012 16:20:30 +0100 [thread overview]
Message-ID: <20120114152030.GX30469@goldbirke> (raw)
In-Reply-To: <vpq7h0ufj87.fsf@bauges.imag.fr>
Hi,
On Sat, Jan 14, 2012 at 03:32:08PM +0100, Matthieu Moy wrote:
> SZEDER Gábor <szeder@ira.uka.de> writes:
> > We could fix the regression by not appending a space suffix to
> > completion words in __gitcomp_nl(), but only when the completion
> > script is running under zsh to avoid hurting bash users, like this:
> >
> > diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> > index 2d02a7f3..49393243 100755
> > --- a/contrib/completion/git-completion.bash
> > +++ b/contrib/completion/git-completion.bash
> > @@ -601,6 +601,9 @@ __gitcomp_nl ()
> > suffix="$4"
> > fi
> > fi
> > + if [ -n "${ZSH_VERSION-}" ] && [ "$suffix" = " " ]; then
> > + suffix=""
> > + fi
> >
> > IFS=$s
> > COMPREPLY=($(compgen -P "${2-}" -S "$suffix" -W "$1" -- "$cur_"))
>
> I hate to see special case for different shells,
I agree and thought about that, too. We are dealing with zsh quirks
in the completion script either by
- having whole functions with different definitions in zsh and
in bash (currently__git_shopt() and _get_comp_words_by_ref()), or
- having similar shell-specific cases inside functions (currently
_git() and _gitk()).
We use the former when the implementations for the two shells differ
significantly, and the latter when the shell-specific parts are small
and most of the function's implementation can be used in both shells.
I think this regression fix fits into the latter category.
> but if no one finds a
> better solution, then yes, this is the way to go. Not having the space
> may be irritating, but having the quoted space hurts really much more (I
> have to delete the space and the backslash manually to continue).
I have no better idea for fixing this regression, and no idea at all
for a proper fix (i.e. to make zsh behave the same way in this respect
as bash). I can imagine that it's irritating, that's why I aimed for
this minimal regression fix, which, maybe with a Tested-by from you or
Stefan, can even go into maint, so affected users can get it faster.
Best,
Gábor
next prev parent reply other threads:[~2012-01-14 15:20 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-12 11:52 Zsh completion regression Stefan Haller
2012-01-12 14:56 ` Matthieu Moy
2012-01-14 13:23 ` SZEDER Gábor
2012-01-14 14:32 ` Matthieu Moy
2012-01-14 15:20 ` SZEDER Gábor [this message]
2012-01-14 18:55 ` [PATCH] bash-completion: don't add quoted space for ZSH (fix regression) Matthieu Moy
2012-01-15 2:29 ` Junio C Hamano
2012-01-16 11:49 ` Matthieu Moy
2012-01-16 22:47 ` Junio C Hamano
2012-01-17 12:21 ` Matthieu Moy
2012-01-17 18:46 ` Junio C Hamano
2012-01-17 19:18 ` Felipe Contreras
2012-01-17 20:03 ` Felipe Contreras
2012-01-17 20:11 ` Junio C Hamano
2012-01-17 23:04 ` Felipe Contreras
2012-01-17 23:42 ` Junio C Hamano
2012-01-18 8:16 ` Matthieu Moy
2012-01-25 1:39 ` Felipe Contreras
2012-01-25 4:06 ` Junio C Hamano
2012-01-14 21:36 ` Zsh completion regression Stefan Haller
2012-01-14 21:36 ` Stefan Haller
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=20120114152030.GX30469@goldbirke \
--to=szeder@ira.uka.de \
--cc=Matthieu.Moy@grenoble-inp.fr \
--cc=git@vger.kernel.org \
--cc=lists@haller-berlin.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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