git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: git@vger.kernel.org, "SZEDER Gábor" <szeder@ira.uka.de>
Subject: Re: [PATCH 1/2] completion: suppress zsh's special 'words' variable
Date: Tue, 10 May 2011 14:43:50 +0300	[thread overview]
Message-ID: <BANLkTi=C26rtgvx+kYpE0YUrwUFrEquphA@mail.gmail.com> (raw)
In-Reply-To: <20110510031708.GD26619@elie>

On Tue, May 10, 2011 at 6:17 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:
> Jonathan Nieder wrote:
>
>>  contrib/completion/git-completion.bash |    2 ++
>>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> I forgot to list changes since v4:
>
>  - new commit message
>  - removed comment I considered unclear --- probably the following
>   should be squashed in, though, to prevent someone from seeing the
>   seemingly redundant "typeset -h words" and removing it, not
>   realizing it is needed for compatibility with old zsh versions.
>
> -- >8 --
> From: Felipe Contreras <felipe.contreras@gmail.com>
> Subject: completion: add a comment to explain what "typeset -h words" is for
>
> In current zsh master, bashcompinit hides the 'words' special variable
> already, so our own "typeset -h words" in _git and _gitk might seem
> redundant.  Add a comment to explain that it is there for
> compatibility with old zsh versions.
>
> [jn: based on the original comment by Felipe Contreras]
>
> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
> ---
>  contrib/completion/git-completion.bash |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index da586e5..b80830e 100755
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -2608,6 +2608,10 @@ _git ()
>        if [[ -n ${ZSH_VERSION-} ]]; then
>                emulate -L bash
>                setopt KSH_TYPESET
> +
> +               # Suppress the "words" special variable from zsh.

That is not accurate. This is hiding the special meaning of the
'words' variable, only locally. "Suppress" denotes that the special
meaning of 'words' is gone forever, even on outer layers of the call
stack.

> +               # Only zsh versions <= 4.3.11 need this --- in later
> +               # versions, bashcompinit takes care of it.

That can be explained in shorter form:

# Workaround for versions < 4.3.12

The word workaround denotes that there's a bug, and by limiting where
the workaround is needed, it's obvious where proper fix is.

All this can be explained in this sentence:

# workaround zsh's bug which leaves 'words' as a special variable in
versions < 4.3.12

What is the need to change that?

-- 
Felipe Contreras

  reply	other threads:[~2011-05-10 11:43 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-09 20:45 [PATCH v3 (for maint)] git-completion: fix zsh support Felipe Contreras
2011-05-09 21:13 ` Jonathan Nieder
2011-05-09 22:08   ` Felipe Contreras
2011-05-09 22:14     ` [PATCH v4 " Felipe Contreras
2011-05-09 22:53       ` Jonathan Nieder
2011-05-09 23:13         ` Felipe Contreras
2011-05-09 23:28           ` Jonathan Nieder
2011-05-09 23:58             ` Felipe Contreras
2011-05-09 23:25         ` Junio C Hamano
2011-05-09 23:35           ` Jonathan Nieder
2011-05-10  2:55       ` [PATCH v5 0/2] " Jonathan Nieder
2011-05-10  2:59         ` [PATCH 1/2] completion: suppress zsh's special 'words' variable Jonathan Nieder
2011-05-10  3:17           ` Jonathan Nieder
2011-05-10 11:43             ` Felipe Contreras [this message]
2011-05-10 11:29           ` Felipe Contreras
2011-05-10  3:00         ` [PATCH 2/2] completion: move private shopt shim for zsh to __git_ namespace Jonathan Nieder
2011-05-10 10:48         ` [PATCH v5 0/2] git-completion: fix zsh support Felipe Contreras
2011-05-10  2:04     ` [PATCH v3 (for maint)] " Jonathan Nieder
2011-05-10 10:44       ` Felipe Contreras

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='BANLkTi=C26rtgvx+kYpE0YUrwUFrEquphA@mail.gmail.com' \
    --to=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jrnieder@gmail.com \
    --cc=szeder@ira.uka.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;
as well as URLs for NNTP newsgroup(s).