On Sat, Feb 22, 2014 at 2:59 PM, Jeff King <p...@peff.net> wrote:
> On Fri, Feb 21, 2014 at 06:58:16PM +0700, Duy Nguyen wrote:
>> >   --sort=[-][comparison:]field
>> [...]
>> Why not reversed order? So its syntax could be
>> [ "-" ] FIELD [ ":" [ "version" | "v" ] ]
>> It fits better to current f-e-r syntax where modifiers are after the
>> colon. And it avoids the possibility that someone adds field "version"
>> and we can't tell what "version" is what.
> I find my version a bit more obvious, for two reasons:
>   1. "version" here is not a modifier of the field name, it is a
>      modifier of the sort. You cannot use it in non-sort contexts (like
>      --format), and you cannot order it like other modifiers (you cannot
>      say "refname:version:short", only "refname:short:version").

Or you can read it like "type cast this field as a version", where
sorting is affected but formatting, not so much. So you can specify it
with --format (but it's no-op, unless we find a fancy way to color
versions). I don't see a problem with accepting both
refname:version:short and refname:short:version in future for-each-ref
either. It will be the first time we accept multiple modifiers though.

>   2. There are actually two sort-modifiers: "-" for ordering, and then a
>      comparator. In your proposal, they are split, whereas in mine, they
>      are next to each other.
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to