Re: [BUG] minor: wrong handling of GIT_AUTHOR_DATE
From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2016-06-15 22:45:10
On Sat, 16 Aug 2008, Junio C Hamano wrote:
People who followed that advice would have gotten used to this already, e.g.
$ git reflog delete master@{07.04.2005.15:15:00.-0700}
should not be broken.Hmm. Fair enough. In that case, just the "nodate()" approach is probably fine on its own. HOWEVER:
I think your first hunk needs to distinguish between "very-long-precision posint" (in which case we ignore because it is likely to be nanoseconds fraction) and others.
Well, that ignores nanosecond resolution seconds, but not microseconds, for example. Now, microseconds normally don't matter (because they won't trigger the 'seconds-since-epoch' case), but they _can_ trigger some other cases. For example, let's assume that we have microseconds in the date specifier. Then try this one: ./test-date "12:12:12.000001" Notice what happens? Oops. With my patch, you get 12:12:12.0000001 -> Sat Aug 16 12:12:12 2008 and with your, you get 12:12:12.000001 -> Fri Aug 1 12:12:12 2008 and yeah, it's odd, but I can explain it. But you are definitely right about the case of doing "15:15:00.-0700" and yes, my patch was crap too. Linus