Subject: Re: [BUG] "git commit --date" format parsing

From: Jeff King <[email-masked]>
Date: Fri, 22 May 2015 18:06:10 -0400

On Fri, May 22, 2015 at 03:18:53PM +0200, Bastien Traverse wrote:

> $ git --version
> git version 2.4.1
> 
> $ uname -a
> Linux arch-clevo 4.0.4-1-ARCH #1 SMP PREEMPT Mon May 18 06:43:19 CEST
> 2015 x86_64 GNU/Linux
> 
> $ mkdir test && cd test/
> $ git init
> $ touch test
> $ git add test
> 
> 1. ISO 8601 (strict)
> 
> $ git commit --date="2015-05-21T16∶31+02:00" -m "Test commit to check
> date format parsing"
> [master (root commit) fed9ae6] Test commit to check date format parsing
>  Date: Thu May 21 02:00:00 2015 +0200
>  1 file changed, 0 insertions(+), 0 deletions(-)
>  create mode 100644 test
> 
>   --> gets the date right but confuses the timezone for the time

OK, this is weird. When I tried to reproduce, I couldn't. But I had
typed in the date string myself while reading your email in another
window.  And though I was sure that I had typed it correctly, just to be
double-plus-sure I copied and pasted your string. And it failed!

The date string in your email looks like this (using cut and paste):

  $ echo 2015-05-21T16∶31+02:00 | xxd
  00000000: 3230 3135 2d30 352d 3231 5431 36e2 88b6  2015-05-21T16...
  00000010: 3331 2b30 323a 3030 0a                   31+02:00.

Your "colon" is actually UTF-8 for code point U+2236 ("RATIO"). So git's
date parser does not recognize it, and punts to approxidate(), which
does all manner of crazy guessing trying to figure out what you meant.

-Peff