From: Junio C Hamano <gitster@pobox.com>
To: Rick van Hattem <wolph@wol.ph>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Use ZSH_NAME instead of ZSH_VERSION because it's redefined by git-completion.zsh
Date: Mon, 04 Jun 2018 12:40:45 +0900 [thread overview]
Message-ID: <xmqqr2ln5ide.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <01020163c683e753-04629405-15f8-4a30-9dc3-e4e3f2a5aa26-000000@eu-west-1.amazonses.com> (Rick van Hattem's message of "Sun, 3 Jun 2018 16:38:43 +0000")
Rick van Hattem <wolph@wol.ph> writes:
> The `git-completion.zsh` unsets the `$ZSH_VERSION` which makes this check moot. The result (at least for me) is that zsh segfaults because of all the variables it's unsetting.
> ---
Overlong line, lack of sign-off.
> # Clear the variables caching builtins' options when (re-)sourcing
> # the completion script.
> -if [[ -n ${ZSH_VERSION-} ]]; then
> +if [[ -n ${ZSH_NAME-} ]]; then
I am not a zsh user, and I do not know how reliable $ZSH_NAME can be
taken as an indication that we are running zsh and have already
found a usable git-completion-.bash script.
I think what the proposed log message refers to as "unsets" is this
part of the script:
...
zstyle -s ":completion:*:*:git:*" script script
if [ -z "$script" ]; then
local -a locations
local e
locations=(
$(dirname ${funcsourcetrace[1]%:*})/git-completion.bash
...
)
for e in $locations; do
test -f $e && script="$e" && break
done
fi
ZSH_VERSION='' . "$script"
...
If your ZSH_VERSION is empty, doesn't it indicate that the script
did not find a usable git-completion.bash script (to which it
outsources the bulk of the completion work)? I do agree segfaulting
is not a friendly way to tell you that your setup is lacking to make
it work, but I have a feeling that what you are seeing is an
indication of a bigger problem, which will be sweeped under the rug
with this patch but without getting fixed...
next prev parent reply other threads:[~2018-06-04 3:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-03 16:38 [PATCH] Use ZSH_NAME instead of ZSH_VERSION because it's redefined by git-completion.zsh Rick van Hattem
2018-06-04 3:40 ` Junio C Hamano [this message]
2018-06-04 14:04 ` Rick van Hattem
2018-06-06 11:41 ` SZEDER Gábor
2018-06-06 12:19 ` Rick van Hattem
2018-06-07 5:08 ` Jonathan Nieder
2018-06-11 17:04 ` Junio C Hamano
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=xmqqr2ln5ide.fsf@gitster-ct.c.googlers.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=wolph@wol.ph \
/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).