Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: nits with new _git
- X-seq: zsh-workers 29453
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Nikolai Weibull <now@xxxxxxxx>
- Subject: Re: nits with new _git
- Date: Fri, 3 Jun 2011 23:39:28 +0200
- Cc: zsh workers <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=sieEfv1SqGOrHW411ueAd+Scy+qRFjShEuxftjFo5Ao=; b=pz9jusNRj/QLe2q2w4By1A/RM/ayTCgkY4mQBZc7IQTHCUwduqVFhqeP+boK+eqiR1 D1GIwoY4Svv1XpkCsUD1uxYTOVTUXfm7ijPvYpguxr+/KyOTgGPuLngUIGlwoO1+j3cc uZTtl/JuIY6VnyTLoNB3gpRIi8kbSETLO1Ark=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=MeF9U0eXXApbdSXLe5D8HGfyF9T0vOx5q1mBAQv/gqGA6Dc/Eh/902IKAUEjQWVaG4 B9+jAhNHF4UNs3q1JsA+wuAc+8jt77idGcnxRWndx+oyqA6Dm0F7YOBpL1beMTjZjFZX EiTpXKpFx26DA7vqso7b31fzbP+PrXYimf/a4=
- In-reply-to: <BANLkTikbLN=MTgHsiQeNsbwYXMaJ7GVP+w@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <BANLkTinV2euaa_w+F7m7U0KMZm1ajYDMUg@mail.gmail.com> <BANLkTikbLN=MTgHsiQeNsbwYXMaJ7GVP+w@mail.gmail.com>
On 17 May 2011 14:56, Nikolai Weibull <now@xxxxxxxx> wrote:
> On Sat, May 14, 2011 at 03:28, Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
>> Now that pws fixed the crash, I'm updating to the new _git, so far
>> I've noticed these two things.
>>
>> git log --pret<tab> goes into correction, same for git show.
>> % git log --pretty=
>> ---- option
>> --pretty -- pretty print commit messages
>> ---- corrections (errors: 2)
>> --grep -- limit commits to those with log messages matching the given pattern
>> --pretty -- pretty print commit messages
>>
>> Usually this would hint at some missing ret=0 somewhere, but I
>> couldn't find any. Unconditionally returning 0 from _git does 'fix' it
>> though, so it must be somewhere.
>
> I can’t reproduce this issue.
This was sort of a mindfuck, but I figured it out :). It looks like
this is a systematic error in the whole _git file, but should be
easily fixed. _git() itself defines local ret=1, then does
_call_function ret _git-$words[1], then _git-log() in this case sets
ret=0 on success. Sounds good? Not really, because it doesn't return
ret, so then _call_function overwrites ret with something else. The
solution would seem to simply not use _call_function since none of the
helper functions return anything, they just set ret directly.
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -6023,11 +6023,11 @@ _git() {
(option-or-argument)
curcontext=${curcontext%:*:*}:git-$words[1]:
- _call_function ret _git-$words[1]
+ _git-$words[1]
;;
esac
else
- _call_function ret _$service
+ _$service
fi
return ret
}
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author