Re: [PATCH v2] tag: support configuring --sort via .gitconfig

2014-07-10 Thread Junio C Hamano
Jeff King p...@peff.net writes: I know this is existing code you are moving, but I noticed it looks ripe for using skip_prefix. Perhaps while we are in the area we should do the following on top of your patch (I'd also be happy for it be squashed in, but that may be too much in one patch). I

Re: [PATCH v2] tag: support configuring --sort via .gitconfig

2014-07-10 Thread Jeff King
On Thu, Jul 10, 2014 at 10:59:36AM -0700, Junio C Hamano wrote: Jeff King p...@peff.net writes: I know this is existing code you are moving, but I noticed it looks ripe for using skip_prefix. Perhaps while we are in the area we should do the following on top of your patch (I'd also be

Re: [PATCH v2] tag: support configuring --sort via .gitconfig

2014-07-10 Thread Keller, Jacob E
On Thu, 2014-07-10 at 00:07 -0400, Jeff King wrote: On Wed, Jul 09, 2014 at 03:36:51PM -0700, Jacob Keller wrote: +static int parse_sort_string(const char *arg) +{ + int sort = 0; + int flags = 0; + + if (*arg == '-') { + flags |= REVERSE_SORT; + arg++;

Re: [PATCH v2] tag: support configuring --sort via .gitconfig

2014-07-10 Thread Keller, Jacob E
On Thu, 2014-07-10 at 15:34 -0400, Jeff King wrote: On Thu, Jul 10, 2014 at 10:59:36AM -0700, Junio C Hamano wrote: Jeff King p...@peff.net writes: I know this is existing code you are moving, but I noticed it looks ripe for using skip_prefix. Perhaps while we are in the area we

Re: [PATCH v2] tag: support configuring --sort via .gitconfig

2014-07-10 Thread Junio C Hamano
Keller, Jacob E jacob.e.kel...@intel.com writes: On Thu, 2014-07-10 at 15:34 -0400, Jeff King wrote: On Thu, Jul 10, 2014 at 10:59:36AM -0700, Junio C Hamano wrote: Jeff King p...@peff.net writes: I know this is existing code you are moving, but I noticed it looks ripe for using

[PATCH v2] tag: support configuring --sort via .gitconfig

2014-07-09 Thread Jacob Keller
Add support for configuring default sort ordering for git tags. Command line option will override this configured value, using the exact same syntax. Cc: Jeff King p...@peff.net Signed-off-by: Jacob Keller jacob.e.kel...@intel.com --- Repost with changes suggested by Peff. These include fixing

Re: [PATCH v2] tag: support configuring --sort via .gitconfig

2014-07-09 Thread Jeff King
On Wed, Jul 09, 2014 at 03:36:51PM -0700, Jacob Keller wrote: Add support for configuring default sort ordering for git tags. Command line option will override this configured value, using the exact same syntax. Thanks, this version looks pretty good to me. A few minor comments: + if

Re: [PATCH v2] tag: support configuring --sort via .gitconfig

2014-07-09 Thread Jeff King
On Wed, Jul 09, 2014 at 03:36:51PM -0700, Jacob Keller wrote: +static int parse_sort_string(const char *arg) +{ + int sort = 0; + int flags = 0; + + if (*arg == '-') { + flags |= REVERSE_SORT; + arg++; + } + if (starts_with(arg, version:)) {