git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git-svn error: Unable to parse date

From
EWEric Wong <normalperson@yhbt.net>
Date
Feb 17, 2009, 21:49 UTC
Message-ID
<20090217214914.GD26706@dcvr.yhbt.net>
In-Reply-To
<20090217193550.GT7504@wouts.nl>
Ward Wouts <ward@wouts.nl> wrote:
Show 41 quoted lines
> On Tue, Feb 17, 2009 at 10:38:32AM -0800, Junio C Hamano wrote:
> > Ward Wouts <ward@wouts.nl> writes:
> > 
> > > Unable to parse date: 2004-03-09T09:44:33.Z
> > >  at /usr/bin/git-svn line 3995
> > 
> > A very nice problem description, illustrating what the code should accept
> > but doesn't.
> 
> Thank you.
> 
> > > The message goes away with this one character patch:
> > >
> > > $ diff -bru git-svn*
> > > --- git-svn     2009-02-17 10:23:24.000000000 +0100
> > > +++ git-svn.orig        2009-02-17 10:20:30.000000000 +0100
> > > @@ -2387,7 +2387,7 @@
> > >  sub parse_svn_date {
> > >         my $date = shift || return '+0000 1970-01-01 00:00:00';
> > >         my ($Y,$m,$d,$H,$M,$S) = ($date =~ /^(\d{4})\-(\d\d)\-(\d\d)T
> > > -                                           (\d\d)\:(\d\d)\:(\d\d).\d*Z$/x) or
> > > +                                           (\d\d)\:(\d\d)\:(\d\d).\d+Z$/x) or
> > >                                          croak "Unable to parse date: $date\n";
> > >         "+0000 $Y-$m-$d $H:$M:$S";
> > >  }
> > 
> > You had me scratch my head by giving a reverse patch.
> 
> Yes, I'm sorry about that. Hopefully my other post about this subject,
> sent after the remarks Deskin made, is in the proper format.
> 
> > I think neither regexp is quite correct, assuming that SVN timestamp is
> > supposed to always have decimal point after seconds, with optional
> > fractional part, followed by Z (presumably to mean Zulu).
> > 
> > -                                           (\d\d)\:(\d\d)\:(\d\d).\d+Z$/x) or
> > +                                           (\d\d)\:(\d\d)\:(\d\d)\.\d*Z$/x) or
> > 
> > The decimal point should get quoted.
> 
> I think you're right.
Yup.  Consider a patch with the quoted decimal point to be
  Acked-by: Eric Wong <normalperson@yhbt.net>
Thanks Junio, Deskin and Ward.
Ward: Just curious, which version of the SVN libraries are you running?

Odd that this hasn't come up before, I wonder if it's the latest versions (which I haven't tried, still on 1.5.1) or if SVN just truncates the zeroes...

-- 
Eric Wong
Previous: Ward WoutsNext: Junio C Hamano
Message 5 of 6 in “git-svn error: Unable to parse date”
  1. Ward WoutsFeb 17, 2009
  2. Deskin MillerFeb 17, 2009
  3. Junio C HamanoFeb 17, 2009
  4. Ward WoutsFeb 17, 2009
  5. Eric WongFeb 17, 2009
  6. Junio C HamanoFeb 19, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.