Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
	T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=googlemail.com; s=20120113;
        h=subject:to:references:cc:from:message-id:date:user-agent
         :mime-version:in-reply-to:content-transfer-encoding;
        bh=CkyunaK+YZ4ehGQUwxsCEJgn3ItbfI8AjgDkTsw0MP0=;
        b=UjzOlaLtNfqHvusTIeN7N5DPA/20RzvmfoNNzSfzhzJlI5uZBSTo+uTcLW+i8GjlSh
         hdNvPhXh0w92g7ptggB4cNNM1avnHBPPH3vjThKexMNY0GAtNEjogbqNq7F9bKal97J3
         qMdmyEfTnrIwUkLq8/hbuyt4fmP73Joma/LHdVk7d1eThivrX2XfC7NzVgXtfVDVTQ68
         9T/Wb5818NgSf27Emx0AL74Lg/rP/ONmGwZqDQpEOwkAswBq0+husQgf0JSkPRhddxqC
         xAd5A8B+yRmnr4L/uEAkooh6IRlB+ZIJZlG82dJQoCn2L6nFCnxKEck53Tui9jQoMMOC
         1DUg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:subject:to:references:cc:from:message-id:date
         :user-agent:mime-version:in-reply-to:content-transfer-encoding;
        bh=CkyunaK+YZ4ehGQUwxsCEJgn3ItbfI8AjgDkTsw0MP0=;
        b=g9pnrFl5mQn2CCPuNtjQfEJ3TPtCdPDRZBIJiODSnRI+0lEFeFklAy5fhgRKShQzdF
         fiymDlZqkVg7i5E5vuUtF+F9lQe4CItkfDDsHkdfqN+2ahrE3NoThhMZtOphpi7qyQ1J
         Jcc+zSt+mvTFdsTmQb4fFmn5+Rrlu6r/1lWS4p6O7IS+g68k8WD1xQyK9QtD++zIGGeZ
         cwD2SFpyhFLTbcHQp8esJkxoR/ogeLQ1IAx+qub2YV7bt1co1gprRv4RTf5VgHd0hSwx
         Pos5IjP9Omrcy6hBDuHEb2F7kEcfsdzECefcR+fURa7m8/WHE9kgdeXAJNKN3UIx7KGB
         moxA==
X-Gm-Message-State: AD7BkJKnOy9l9rxiJ/yDPHzStGKJrEXjt5bTUL01mNuONBlJ25RFGeUjRlxhkcY6IVnq5w==
X-Received: by 10.194.91.233 with SMTP id ch9mr5883437wjb.121.1458161018634;
        Wed, 16 Mar 2016 13:43:38 -0700 (PDT)
Subject: Re: [PATCH 3/4] _git: log: ignore numeric options
To: Daniel Shahaf <d.s@daniel.shahaf.name>
References: <1457906520-2612-1-git-send-email-m0viefreak.cm@googlemail.com>
 <1457906520-2612-4-git-send-email-m0viefreak.cm@googlemail.com>
 <20160315000837.GA29956@tarsus.local2>
Cc: zsh-workers@zsh.org
From: m0viefreak <m0viefreak.cm@googlemail.com>
Message-ID: <56E9C579.70608@googlemail.com>
Date: Wed, 16 Mar 2016 21:43:37 +0100
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101
 Thunderbird/38.6.0
MIME-Version: 1.0
In-Reply-To: <20160315000837.GA29956@tarsus.local2>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Seq: zsh-workers 38164



On 15.03.2016 01:08, Daniel Shahaf wrote:
> I couldn't reproduce that: with current master, none of «git log
> -<TAB>», «git log -9<TAB>», or «git log -9 -<TAB>» go through the
> 'first-commit-ranges-or-files' code branch.
> 
> m0viefreak, if there is still a (possibly latent) bug in current master,
> could you please explain/show it?

git log -9 <TAB>

should go through the 'first-commit-ranges-or-files' branch because at
that position the first argument is expected.

Without this patch it goes through the 'commit-ranges-or-files' branch,
because '-9' is wrongly treated as the first non-option argument:


functions -T _git-log; git log -9 <TAB>

without this patch:
+_git-log:16> case commit-ranges-or-files (first-commit-ranges-or-files)
+_git-log:16> case commit-ranges-or-files (commit-ranges-or-files)
+_git-log:28> [[ -z '' ]]
+_git-log:29> __git_commit_ranges
+_git-log:29> ret=0
+_git-log:35> __git_is_committish_range -9
+_git-log:37> __git_is_committish -9
+_git-log:40> __git_tree_files . HEAD
+_git-log:40> ret=0
+_git-log:45> return ret

with this patch:
+_git-log:16> case first-commit-ranges-or-files (first-commit-ranges-or-files)
+_git-log:18> [[ -n '' ]]
+_git-log:21> _alternative commit-ranges::__git_commit_ranges 'cached-files::__git_tree_files ${PREFIX:-.} HEAD'
+_git-log:23> ret=0
+_git-log:45> return ret


This patch makes _arguments ignore any words of the form '-[0-9]#' to
work around that.

