Re: [PATCH 2/2] date: make "local" orthogonal to date format

2015-09-03 Thread Junio C Hamano
John Keeping writes: > On Wed, Sep 02, 2015 at 05:30:14PM -0400, Jeff King wrote: >> I think the error message would be a lot nicer if we indicate that "-" >> is syntactically interesting, and say: >> >> fatal: unknown date-mode modifier: locale > > I wonder if we'd be better just saying: > >

Re: [PATCH 2/2] date: make "local" orthogonal to date format

2015-09-02 Thread John Keeping
On Wed, Sep 02, 2015 at 05:30:14PM -0400, Jeff King wrote: > On Wed, Sep 02, 2015 at 10:41:34AM -0700, Junio C Hamano wrote: > > > Jeff King writes: > > > > > + /* historical alias */ > > > + if (!strcmp(format, "local")) > > > + format = "default-local"; > > > + > > > + mode->type = par

Re: [PATCH 2/2] date: make "local" orthogonal to date format

2015-09-02 Thread Jeff King
On Wed, Sep 02, 2015 at 10:41:34AM -0700, Junio C Hamano wrote: > Jeff King writes: > > > + /* historical alias */ > > + if (!strcmp(format, "local")) > > + format = "default-local"; > > + > > + mode->type = parse_date_type(format, &p); > > + mode->local = 0; > > + > > + if (

Re: [PATCH 2/2] date: make "local" orthogonal to date format

2015-09-02 Thread Junio C Hamano
Jeff King writes: > + /* historical alias */ > + if (!strcmp(format, "local")) > + format = "default-local"; > + > + mode->type = parse_date_type(format, &p); > + mode->local = 0; > + > + if (skip_prefix(p, "-local", &p)) { > + if (mode->type == DATE_RE

Re: [PATCH 2/2] date: make "local" orthogonal to date format

2015-09-01 Thread John Keeping
On Mon, Aug 31, 2015 at 06:05:09PM -0400, Jeff King wrote: > On Mon, Aug 31, 2015 at 05:33:37PM -0400, Jeff King wrote: > > > > diff --git a/date.c b/date.c > > > index aa57cad..3aa8002 100644 > > > --- a/date.c > > > +++ b/date.c > > > @@ -817,9 +817,7 @@ void parse_date_format(const char *format

Re: [PATCH 2/2] date: make "local" orthogonal to date format

2015-08-31 Thread Jeff King
On Mon, Aug 31, 2015 at 05:33:37PM -0400, Jeff King wrote: > > diff --git a/date.c b/date.c > > index aa57cad..3aa8002 100644 > > --- a/date.c > > +++ b/date.c > > @@ -817,9 +817,7 @@ void parse_date_format(const char *format, struct > > date_mode *mode) > > if (!skip_prefix(p, ":", &

Re: [PATCH 2/2] date: make "local" orthogonal to date format

2015-08-31 Thread Jeff King
On Mon, Aug 31, 2015 at 10:27:54PM +0100, John Keeping wrote: > This fails t6300 with: > > fatal: unknown date-mode modifier: my date is %Y-%m-%d > not ok 83 - Check format of strftime date fields > # > # echo "my date is 2006-07-03" >expected && > # git for-each-ref \

Re: [PATCH 2/2] date: make "local" orthogonal to date format

2015-08-31 Thread John Keeping
On Mon, Aug 31, 2015 at 04:48:32PM -0400, Jeff King wrote: > Most of our "--date" modes are about the format of the date: > which items we show and in what order. But "--date=local" is > a bit of an oddball. It means "show the date in the normal > format, but using the local timezone". The timezone

[PATCH 2/2] date: make "local" orthogonal to date format

2015-08-31 Thread Jeff King
Most of our "--date" modes are about the format of the date: which items we show and in what order. But "--date=local" is a bit of an oddball. It means "show the date in the normal format, but using the local timezone". The timezone we use is orthogonal to the actual format, and there is no reason