Re: [PATCH] tag: support --sort=version

2014-02-22 Thread Duy Nguyen
On Sat, Feb 22, 2014 at 2:59 PM, Jeff King 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 syn

Re: [PATCH] tag: support --sort=version

2014-02-22 Thread Jeff King
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 th

Re: [PATCH] tag: support --sort=version

2014-02-21 Thread Junio C Hamano
Duy Nguyen writes: > 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

Re: [PATCH] tag: support --sort=version

2014-02-21 Thread Duy Nguyen
On Fri, Feb 21, 2014 at 3:43 AM, Jeff King wrote: > I think I actually prefer the full word "version", as you have already. > It's clear what it means, and we can extend the syntax generally to: Agreed. It's hard to find a letter that reminds you about "version". > > --sort=[-][comparison:]fie

Re: [PATCH] tag: support --sort=version

2014-02-20 Thread Jeff King
On Wed, Feb 19, 2014 at 09:19:24PM +0700, Duy Nguyen wrote: > > We don't need to do any of that immediately. This is mostly just me > > thinking aloud, to make sure we do not paint ourselves into a corner > > compatibility-wise. > > Good thinking. If you plan to use the exact same sort syntax f-

Re: [PATCH] tag: support --sort=version

2014-02-19 Thread Eric Sunshine
On Wed, Feb 19, 2014 at 8:39 AM, Nguyễn Thái Ngọc Duy wrote: > --sort=version sorts tags as versions. GNU extension's strverscmp is > used and no real compat implementation is provided so this is Linux only. > > Signed-off-by: Nguyễn Thái Ngọc Duy > --- > diff --git a/Documentation/git-tag.txt b/

Re: [PATCH] tag: support --sort=version

2014-02-19 Thread Duy Nguyen
On Wed, Feb 19, 2014 at 9:09 PM, Jeff King wrote: > On Wed, Feb 19, 2014 at 08:39:27PM +0700, Nguyễn Thái Ngọc Duy wrote: > >> --sort=version sorts tags as versions. GNU extension's strverscmp is >> used and no real compat implementation is provided so this is Linux only. > > Sounds like a good go

Re: [PATCH] tag: support --sort=version

2014-02-19 Thread Jeff King
On Wed, Feb 19, 2014 at 08:39:27PM +0700, Nguyễn Thái Ngọc Duy wrote: > --sort=version sorts tags as versions. GNU extension's strverscmp is > used and no real compat implementation is provided so this is Linux only. Sounds like a good goal. I wonder, if we were to merge the for-each-ref and tag

[PATCH] tag: support --sort=version

2014-02-19 Thread Nguyễn Thái Ngọc Duy
--sort=version sorts tags as versions. GNU extension's strverscmp is used and no real compat implementation is provided so this is Linux only. Signed-off-by: Nguyễn Thái Ngọc Duy --- I didn't know that coreutils' sort is simply a wrapper of strverscmp. With that GNU extension, implementing --so