From: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] bash-completion: don't add quoted space for ZSH (fix regression)
Date: Mon, 16 Jan 2012 12:49:08 +0100 [thread overview]
Message-ID: <vpqhazv3m17.fsf@bauges.imag.fr> (raw)
In-Reply-To: <7vsjjhwvdy.fsf@alter.siamese.dyndns.org> (Junio C. Hamano's message of "Sat, 14 Jan 2012 18:29:45 -0800")
Junio C Hamano <gitster@pobox.com> writes:
> but is that the right thing to do if suffix came from "$4"?
>
> As far as I can see, "$4" is used to append "." in very limited cases, and
> nobody explicitly passes SP as "$4" when calling this, so it may be easier
> to read if you moved this before that "if we have 3 or more args, use the
> fourth one as the suffix" block, i.e. something like this?
Why not, but in case someone explicitely passes " " as $4 in the future,
it's likely to be better to strip it for the same reason we strip it here.
I don't care much either way in this case.
> + # Because we use '-o nospace' under bash, we need to compensate
> + # for it by appending SP after completed word ourselves.
> + local suffix="${BASH_VERSION+ }"
Not sure why you reworded the comment, but I don't think it's a good
idea to remove the "ZSH would quote the trailing space added with -S"
that I had added, because this is really the reason we do a special case
here. Your version is misleading, because we use -o nospace for ZSH too.
So, overall, I prefer my version ;-).
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
next prev parent reply other threads:[~2012-01-16 11:49 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
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 [this message]
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=vpqhazv3m17.fsf@bauges.imag.fr \
--to=matthieu.moy@grenoble-inp.fr \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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;
as well as URLs for NNTP newsgroup(s).