Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH 3/4] _git: log: ignore numeric options
- X-seq: zsh-workers 38166
- From: m0viefreak <m0viefreak.cm@xxxxxxxxxxxxxx>
- To: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- Subject: Re: [PATCH 3/4] _git: log: ignore numeric options
- Date: Thu, 17 Mar 2016 00:00:02 +0100
- Cc: zsh-workers@xxxxxxx
- 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=hLBac+X+NPIkBPFh6mwT5awxrDX/7o6nHdkLBFc5YC0=;        b=aRqj9O8F+laK1TrQ0mCkif7W/9uZpeKkyYqkEUw4AGMNiP3IX99z/MHP4tEBz+TFmm         Q/6uLrOi1uSp2dzFOYRPwGklkJtEia3lxw4Od8A1y2zMuJ40ykvNoEnUINkL8YWpZoM7         VqHEvAfO1AOpeGOlL+lkukFd8aGslbMSHh0QDoiyfaasX7+rNV0bVgIlBJHCaKLzFjOM         sE9ubYyxSB3JqOYy/J8IcQ/Lrg7zOXSu27XkhLz9btlKGodIBY7JcvaXB2ZfhLDgEdkG         s7eZ3b3rNYAGsdgoYZQ3k1ppSIKL+naeXj2ksli9B0Yy53u7f4axupQhoYTmOFc48nJ6         cyCw==
- In-reply-to: <20160316223932.GA31897@tarsus.local2>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- 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> <56E9C579.70608@googlemail.com> <20160316223932.GA31897@tarsus.local2>
> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author