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 the possibility

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

2014-02-22 Thread Duy Nguyen
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

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

2014-02-21 Thread Duy Nguyen
On Fri, Feb 21, 2014 at 3:43 AM, Jeff King p...@peff.net 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.

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

2014-02-21 Thread Junio C Hamano
Duy Nguyen pclo...@gmail.com 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-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-e-r

[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 pclo...@gmail.com --- I didn't know that coreutils' sort is simply a wrapper of strverscmp. With that GNU extension,

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

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

2014-02-19 Thread Duy Nguyen
On Wed, Feb 19, 2014 at 9:09 PM, Jeff King p...@peff.net 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

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 pclo...@gmail.com 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 pclo...@gmail.com --- diff --git