Re: [PATCH 13/13] parse_opt_ref_sorting: always use with NONEG flag

2019-03-20 Thread Jeff King
On Wed, Mar 20, 2019 at 01:22:22PM +0100, Martin Ågren wrote: > > +#define OPT_REF_SORT(var) \ > > + OPT_CALLBACK_F(0, "sort", (var), \ > > + N_("key"), N_("field name to sort"), \ > > + PARSE_OPT_NONEG, parse_opt_ref_sorting) > > This one is not id

Re: [PATCH 13/13] parse_opt_ref_sorting: always use with NONEG flag

2019-03-20 Thread Martin Ågren
On Wed, 20 Mar 2019 at 09:17, Jeff King wrote: > - since this was cut-and-pasted to four different spots, let's define > a single OPT_REF_SORT() macro that we can use everywhere Indeed, all four are identical. And FWIW I failed to find a fifth caller anywhere (I looked for "OPT_CALLBACK.*so

[PATCH 13/13] parse_opt_ref_sorting: always use with NONEG flag

2019-03-20 Thread Jeff King
The "--sort" parameter of for-each-ref, etc, does not handle negation, and instead returns an error to the parse-options code. But neither piece of code prints anything for the user, which may leave them confused: $ git for-each-ref --no-sort $ echo $? 129 As the comment in the callback fun