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 autolearn=ham
	autolearn_force=no version=3.4.1
Date: Tue, 15 Mar 2016 00:08:37 +0000
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: m0viefreak <m0viefreak.cm@googlemail.com>
Cc: zsh-workers@zsh.org
Subject: Re: [PATCH 3/4] _git: log: ignore numeric options
Message-ID: <20160315000837.GA29956@tarsus.local2>
References: <1457906520-2612-1-git-send-email-m0viefreak.cm@googlemail.com>
 <1457906520-2612-4-git-send-email-m0viefreak.cm@googlemail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <1457906520-2612-4-git-send-email-m0viefreak.cm@googlemail.com>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Seq: zsh-workers 38158

m0viefreak wrote on Sun, Mar 13, 2016 at 23:01:59 +0100:
> git log allows -<number> arguments as a synonym for -n <number>,
> This however broke completion of further option arguments.
> 

m0viefreak reported on IRC the breakage does not occur since
workers/36236 (a4c41fff1261), but suggested the patch was still needed
to avoid numeric options being parsed by _git-log as the first
positional argument.

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?

Thanks,

Daniel

P.S. The two case branches should probably be combined now: 36236 made
them very similar.

> Simply ignore all numeric options to make it work.
> ---
>  Completion/Unix/Command/_git | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
> index 1241058..023740e 100644
> --- a/Completion/Unix/Command/_git
> +++ b/Completion/Unix/Command/_git
> @@ -1087,7 +1087,7 @@ _git-log () {
>    __git_setup_log_options
>    __git_setup_revision_options
>  
> -  _arguments -w -C -s \
> +  _arguments -w -C -s -A "-[0-9]#" \
>      $log_options \
>      $revision_options \
>      '-L+[trace the evolution of a line range or regex within a file]:range' \
> -- 
> 2.5.0.234.gefc8a62
> 
> 

