From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16868 invoked by alias); 3 Jun 2011 21:39:36 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 29453 Received: (qmail 464 invoked from network); 3 Jun 2011 21:39:34 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.220.171 as permitted sender) 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= MIME-Version: 1.0 In-Reply-To: References: Date: Fri, 3 Jun 2011 23:39:28 +0200 Message-ID: Subject: Re: nits with new _git From: Mikael Magnusson To: Nikolai Weibull Cc: zsh workers Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 17 May 2011 14:56, Nikolai Weibull wrote: > On Sat, May 14, 2011 at 03:28, Mikael Magnusson 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 goes into correction, same for git show. >> % git log --pretty=3D >> ---- 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=3D0 somewhere, but I >> couldn't find any. Unconditionally returning 0 from _git does 'fix' it >> though, so it must be somewhere. > > I can=E2=80=99t 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=3D1, then does _call_function ret _git-$words[1], then _git-log() in this case sets ret=3D0 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=3D${curcontext%:*:*}:git-$words[1]: - _call_function ret _git-$words[1] + _git-$words[1] ;; esac else - _call_function ret _$service + _$service fi return ret } --=20 Mikael Magnusson