On Tue, May 03, 2011 at 02:22:07PM -0500, Jonathan Nieder wrote:
> Josh Triplett wrote:
> 
> > Git's "raw" date format consists of the seconds since the epoch as an
> > integer, followed by a timezone offset.  I wanted to generate a dummy
> > commit with a date of the epoch, so I specified
> > GIT_AUTHOR_DATE='0 +0000'.  However, git said "fatal: invalid date
> > format: 0 +0000".  From looking at the code, it turns out that git won't
> > accept seconds-since-the-epoch unless greater than 100000000.
> 
> Yep, that's true.  Git generally expects realistic dates (much to the
> annoyance of people trying to track historical documents like the
> Constitution of the United States in it).  If the error message were
> changed to specify what about the date it doesn't like, would that
> help?

Specifying what about the date it didn't like would help track down the
problem, though I'd still prefer to have a solution. :)

> Perhaps the rule should be, wherever you see a timezone, it has to be
> preceded by a time (seconds-since-epoch or hh:mm:ss[.sss...]).
> Otherwise the command
> 
>       git commit --date='19970101 +0000'
> 
> has ambiguous meaning.

That sounds promising to me.  In general, I don't think it makes sense
to parse a date and timezone without a time, when you could instead
interpret it as a seconds-since-epoch and timezone.

- Josh Triplett



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to