zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Nikolai Weibull <now@bitwi.se>
Cc: zsh workers <zsh-workers@zsh.org>
Subject: Re: nits with new _git
Date: Fri, 3 Jun 2011 23:39:28 +0200	[thread overview]
Message-ID: <BANLkTi=pMjD5rBJRaZrj5FLWVbndGAMGYg@mail.gmail.com> (raw)
In-Reply-To: <BANLkTikbLN=MTgHsiQeNsbwYXMaJ7GVP+w@mail.gmail.com>

On 17 May 2011 14:56, Nikolai Weibull <now@bitwi.se> wrote:
> On Sat, May 14, 2011 at 03:28, Mikael Magnusson <mikachu@gmail.com> 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


  parent reply	other threads:[~2011-06-03 21:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-14  1:28 Mikael Magnusson
2011-05-14  1:46 ` Mikael Magnusson
2011-05-14  8:38   ` Nikolai Weibull
2011-05-17 13:02   ` Nikolai Weibull
2011-05-14  3:13 ` build problem with patch level 1.5301 S. Cowles
2011-05-14  4:00   ` Bart Schaefer
2011-05-14 16:22     ` Peter Stephenson
2011-05-17 12:56 ` nits with new _git Nikolai Weibull
2011-05-29 15:11   ` Nikolai Weibull
2011-06-03 21:39   ` Mikael Magnusson [this message]
2011-07-20 11:28     ` Nikolai Weibull
2011-07-21  9:06       ` Nikolai Weibull
2011-07-21  9:57         ` Mikael Magnusson

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=pMjD5rBJRaZrj5FLWVbndGAMGYg@mail.gmail.com' \
    --to=mikachu@gmail.com \
    --cc=now@bitwi.se \
    --cc=zsh-workers@zsh.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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).