Subject: Re: [PATCH 3/4] _git: log: ignore numeric options
From: m0viefreak <[email-masked]>
To: Daniel Shahaf <[email-masked]>
Cc: [email-masked]
Date: Thu, 17 Mar 2016 00:00:02 +0100
List-Id: Zsh Workers List <zsh-workers.zsh.org>

> Using '_arguments -A' breaks «git log origin -<TAB>», which is a valid
> syntax.

Oh. Thats's not good.

> How about adding 10 options, -0 through -9, which each take an optional
> argument that must be in the same word?  That is:
> .
>     _arguments : '-'{0..9}'-[lorem ipsum]: :_guard "[0-9]#" "numeric value"'
> .
> ?

That is probably the "correct" solution. I wanted to do something like that
initially, but I noticed that it pollutes verbose menu completion a lot:

Completing: option
--                                                                          -- start file arguments
-9                        -8                -7  -6  -5  -4  -3  -2  -1  -0  -- lorem ipsum
--abbrev                                                                    -- set minimum SHA1 display-length (for use with --abbrev-commit)
--abbrev                                                                    -- set minimum SHA1 display-length
--abbrev-commit                                                             -- show only partial prefixes of commit object names
--after                   --since                                           -- show commits more recent than given date
--all                                                                       -- show all commits from refs
...

So instead I went with -A. But I didn't notice that side effect above.

Using no description at least puts them at the end, but it's still ugly:

...
--topo-order                                    -- display commits in topological order
--unified                 -U                    -- generate diff with given lines of context
--use-mailmap                                   -- use mailmap file to map author and committer names and email
--walk-reflogs            -g                    -- walk reflog entries from most recent to oldest
--word-diff                                     -- show word diff
--word-diff-regex                               -- specify what constitutes a word
-z                                              -- use NUL termination on output
-0             -1             -2             -3             -4             -5             -6             -7             -8             -9