{"thread":{"id":"17850","subject":"git-svn error: Unable to parse date","startedAt":"2009-02-17T09:48:50Z","lastAt":"2009-02-19T00:53:51Z","messageCount":6,"participants":["Ward Wouts","Deskin Miller","Junio C Hamano","Eric Wong"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"105113","messageId":"20090217094850.GQ7504@wouts.nl","threadId":"17850","inReplyTo":null,"subject":"git-svn error: Unable to parse date","fromName":"Ward Wouts","fromEmail":"ward@wouts.nl","sentAt":"2009-02-17T09:48:50Z","receivedAt":"2009-02-17T09:48:50Z","isPatch":false,"sender":{"key":"ward@wouts.nl","avatar":null},"body":"Hello,\n\nI got the following error message while trying to fetch a subversion\nrepository:\n\n$ git svn init file:///home/mg/svn/mg git-svn-test\nInitialized empty Git repository in /home/ward/worktrees/git-svn-test/.git/\n$ cd git-svn-test\n$ git svn fetch\n\nr59 = c20f5b6c61bb8b2babc1b3644b6372e023d9d428 (git-svn)\nW: +empty_dir: CFE\nr60 = 1b8ad7c39dd60897319545c9f3f08b3b2b82b863 (git-svn)\n        A       CFE/Makefile\nUnable to parse date: 2004-03-09T09:44:33.Z\n at /usr/bin/git-svn line 3995\n\n\nThe message goes away with this one character patch:\n\n$ diff -bru git-svn*\n--- git-svn     2009-02-17 10:23:24.000000000 +0100\n+++ git-svn.orig        2009-02-17 10:20:30.000000000 +0100\n@@ -2387,7 +2387,7 @@\n sub parse_svn_date {\n        my $date = shift || return '+0000 1970-01-01 00:00:00';\n        my ($Y,$m,$d,$H,$M,$S) = ($date =~ /^(\\d{4})\\-(\\d\\d)\\-(\\d\\d)T\n-                                           (\\d\\d)\\:(\\d\\d)\\:(\\d\\d).\\d*Z$/x) or\n+                                           (\\d\\d)\\:(\\d\\d)\\:(\\d\\d).\\d+Z$/x) or\n                                         croak \"Unable to parse date: $date\\n\";\n        \"+0000 $Y-$m-$d $H:$M:$S\";\n }\n\n\n\nAs the matching digits get ignored I don't see how this patch could introduce a\nproblem. Then again, I'm just starting with git and don't know anything about\nthe internals of either git or subversion.\n\nWard\n"},{"id":"105153","messageId":"86d4c5e00902170626q7d460a30l168ecd227db69a46@mail.gmail.com","threadId":"17850","inReplyTo":"20090217094850.GQ7504@wouts.nl","subject":"Re: git-svn error: Unable to parse date","fromName":"Deskin Miller","fromEmail":"deskinm@gmail.com","sentAt":"2009-02-17T14:26:29Z","receivedAt":"2009-02-17T14:26:29Z","isPatch":false,"sender":{"key":"deskinm@gmail.com","avatar":null},"body":"Hi,\n\nCc:ing Eric Wong, the git-svn author; further comments inline.\n\nOn Tue, Feb 17, 2009 at 04:48, Ward Wouts <ward@wouts.nl> wrote:\n> $ git svn fetch\n> Unable to parse date: 2004-03-09T09:44:33.Z\n>  at /usr/bin/git-svn line 3995\n>\n> The message goes away with this one character patch:\n>\n> $ diff -bru git-svn*\n\nNot using git to hack on git?\n\n> --- git-svn     2009-02-17 10:23:24.000000000 +0100\n> +++ git-svn.orig        2009-02-17 10:20:30.000000000 +0100\n> @@ -2387,7 +2387,7 @@\n>  sub parse_svn_date {\n>        my $date = shift || return '+0000 1970-01-01 00:00:00';\n>        my ($Y,$m,$d,$H,$M,$S) = ($date =~ /^(\\d{4})\\-(\\d\\d)\\-(\\d\\d)T\n> -                                           (\\d\\d)\\:(\\d\\d)\\:(\\d\\d).\\d*Z$/x) or\n> +                                           (\\d\\d)\\:(\\d\\d)\\:(\\d\\d).\\d+Z$/x) or\n>                                         croak \"Unable to parse date: $date\\n\";\n>        \"+0000 $Y-$m-$d $H:$M:$S\";\n>  }\n\nI was rather confused until I looked at the source currently in git,\nbut it looks like you have the patch lines backward.  Looking at the\ndiff header now that's more clear to me.  At any rate, it's clear why\nthis date didn't parse, and why your patch fixes it.\n\nI don't have any idea what sort of date format git should be expecting\nfrom svn, so the possibility exists that the current regex is actually\ncorrect and svn is buggily leaving off the subseconds.  Especially\ngiven that this timestamp issue doesn't seem to have come up before,\nthat feels like a very real possibility.  All the same, even if it is\nsvn's fault, we likely want to adjust to accommodate faulty svn\ninstalls, certainly in easy cases like this; but I'll defer to Eric in\nthat regard.\n\nI appreciate the time you took to address this issue, and go so far as\nto submit a patch, but you'll be much farther ahead if you use git to\nsubmit patches to git.  Your patch is pretty small and easy to\nunderstand, but it's still lacking a commit message and a signoff from\nyou, and the diff is actually backwards.  Patches in this state often\nend up dropped on the floor on this list- there's too much work to be\ndone to spend our time on stuff where people haven't used the list\nconventions.  It'd be a shame for any further work you do improving\ngit go to waste, especially when it's not hard to correct, so I'm\ntrying to help out now by pointing you in the right direction.  You\ncan find git.git on the web at the following address, along with git\nURLs from which you can clone:\n\nhttp://git.kernel.org/?p=git/git.git;a=summary\n\nWithin the repository, Documentation/SubmittingPatches is your best\nguide to sending stuff to the mailing list.\n\nIn anticipation of a proper commit message and the like, this patch is\n\nAcked-by: Deskin Miller <deskinm@umich.edu>\n"},{"id":"105198","messageId":"7vd4dg6h93.fsf@gitster.siamese.dyndns.org","threadId":"17850","inReplyTo":"20090217094850.GQ7504@wouts.nl","subject":"Re: git-svn error: Unable to parse date","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-02-17T18:38:32Z","receivedAt":"2009-02-17T18:38:32Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ward Wouts <ward@wouts.nl> writes:\n\n> Unable to parse date: 2004-03-09T09:44:33.Z\n>  at /usr/bin/git-svn line 3995\n\nA very nice problem description, illustrating what the code should accept\nbut doesn't.\n\n> The message goes away with this one character patch:\n>\n> $ diff -bru git-svn*\n> --- git-svn     2009-02-17 10:23:24.000000000 +0100\n> +++ git-svn.orig        2009-02-17 10:20:30.000000000 +0100\n> @@ -2387,7 +2387,7 @@\n>  sub parse_svn_date {\n>         my $date = shift || return '+0000 1970-01-01 00:00:00';\n>         my ($Y,$m,$d,$H,$M,$S) = ($date =~ /^(\\d{4})\\-(\\d\\d)\\-(\\d\\d)T\n> -                                           (\\d\\d)\\:(\\d\\d)\\:(\\d\\d).\\d*Z$/x) or\n> +                                           (\\d\\d)\\:(\\d\\d)\\:(\\d\\d).\\d+Z$/x) or\n>                                          croak \"Unable to parse date: $date\\n\";\n>         \"+0000 $Y-$m-$d $H:$M:$S\";\n>  }\n\nYou had me scratch my head by giving a reverse patch.\n\nI think neither regexp is quite correct, assuming that SVN timestamp is\nsupposed to always have decimal point after seconds, with optional\nfractional part, followed by Z (presumably to mean Zulu).\n\n-                                           (\\d\\d)\\:(\\d\\d)\\:(\\d\\d).\\d+Z$/x) or\n+                                           (\\d\\d)\\:(\\d\\d)\\:(\\d\\d)\\.\\d*Z$/x) or\n\nThe decimal point should get quoted.\n"},{"id":"105210","messageId":"20090217193550.GT7504@wouts.nl","threadId":"17850","inReplyTo":"7vd4dg6h93.fsf@gitster.siamese.dyndns.org","subject":"Re: git-svn error: Unable to parse date","fromName":"Ward Wouts","fromEmail":"ward@wouts.nl","sentAt":"2009-02-17T19:35:50Z","receivedAt":"2009-02-17T19:35:50Z","isPatch":false,"sender":{"key":"ward@wouts.nl","avatar":null},"body":"On Tue, Feb 17, 2009 at 10:38:32AM -0800, Junio C Hamano wrote:\n> Ward Wouts <ward@wouts.nl> writes:\n> \n> > Unable to parse date: 2004-03-09T09:44:33.Z\n> >  at /usr/bin/git-svn line 3995\n> \n> A very nice problem description, illustrating what the code should accept\n> but doesn't.\n\nThank you.\n\n> > The message goes away with this one character patch:\n> >\n> > $ diff -bru git-svn*\n> > --- git-svn     2009-02-17 10:23:24.000000000 +0100\n> > +++ git-svn.orig        2009-02-17 10:20:30.000000000 +0100\n> > @@ -2387,7 +2387,7 @@\n> >  sub parse_svn_date {\n> >         my $date = shift || return '+0000 1970-01-01 00:00:00';\n> >         my ($Y,$m,$d,$H,$M,$S) = ($date =~ /^(\\d{4})\\-(\\d\\d)\\-(\\d\\d)T\n> > -                                           (\\d\\d)\\:(\\d\\d)\\:(\\d\\d).\\d*Z$/x) or\n> > +                                           (\\d\\d)\\:(\\d\\d)\\:(\\d\\d).\\d+Z$/x) or\n> >                                          croak \"Unable to parse date: $date\\n\";\n> >         \"+0000 $Y-$m-$d $H:$M:$S\";\n> >  }\n> \n> You had me scratch my head by giving a reverse patch.\n\nYes, I'm sorry about that. Hopefully my other post about this subject,\nsent after the remarks Deskin made, is in the proper format.\n\n> I think neither regexp is quite correct, assuming that SVN timestamp is\n> supposed to always have decimal point after seconds, with optional\n> fractional part, followed by Z (presumably to mean Zulu).\n> \n> -                                           (\\d\\d)\\:(\\d\\d)\\:(\\d\\d).\\d+Z$/x) or\n> +                                           (\\d\\d)\\:(\\d\\d)\\:(\\d\\d)\\.\\d*Z$/x) or\n> \n> The decimal point should get quoted.\n\nI think you're right.\n\nWard\n"},{"id":"105220","messageId":"20090217214914.GD26706@dcvr.yhbt.net","threadId":"17850","inReplyTo":"20090217193550.GT7504@wouts.nl","subject":"Re: git-svn error: Unable to parse date","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2009-02-17T21:49:14Z","receivedAt":"2009-02-17T21:49:14Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Ward Wouts <ward@wouts.nl> wrote:\n> On Tue, Feb 17, 2009 at 10:38:32AM -0800, Junio C Hamano wrote:\n> > Ward Wouts <ward@wouts.nl> writes:\n> > \n> > > Unable to parse date: 2004-03-09T09:44:33.Z\n> > >  at /usr/bin/git-svn line 3995\n> > \n> > A very nice problem description, illustrating what the code should accept\n> > but doesn't.\n> \n> Thank you.\n> \n> > > The message goes away with this one character patch:\n> > >\n> > > $ diff -bru git-svn*\n> > > --- git-svn     2009-02-17 10:23:24.000000000 +0100\n> > > +++ git-svn.orig        2009-02-17 10:20:30.000000000 +0100\n> > > @@ -2387,7 +2387,7 @@\n> > >  sub parse_svn_date {\n> > >         my $date = shift || return '+0000 1970-01-01 00:00:00';\n> > >         my ($Y,$m,$d,$H,$M,$S) = ($date =~ /^(\\d{4})\\-(\\d\\d)\\-(\\d\\d)T\n> > > -                                           (\\d\\d)\\:(\\d\\d)\\:(\\d\\d).\\d*Z$/x) or\n> > > +                                           (\\d\\d)\\:(\\d\\d)\\:(\\d\\d).\\d+Z$/x) or\n> > >                                          croak \"Unable to parse date: $date\\n\";\n> > >         \"+0000 $Y-$m-$d $H:$M:$S\";\n> > >  }\n> > \n> > You had me scratch my head by giving a reverse patch.\n> \n> Yes, I'm sorry about that. Hopefully my other post about this subject,\n> sent after the remarks Deskin made, is in the proper format.\n> \n> > I think neither regexp is quite correct, assuming that SVN timestamp is\n> > supposed to always have decimal point after seconds, with optional\n> > fractional part, followed by Z (presumably to mean Zulu).\n> > \n> > -                                           (\\d\\d)\\:(\\d\\d)\\:(\\d\\d).\\d+Z$/x) or\n> > +                                           (\\d\\d)\\:(\\d\\d)\\:(\\d\\d)\\.\\d*Z$/x) or\n> > \n> > The decimal point should get quoted.\n> \n> I think you're right.\n\nYup.  Consider a patch with the quoted decimal point to be\n  Acked-by: Eric Wong <normalperson@yhbt.net>\n\nThanks Junio, Deskin and Ward.\n\n\nWard: Just curious, which version of the SVN libraries are you running?\n\nOdd that this hasn't come up before, I wonder if it's the latest\nversions (which I haven't tried, still on 1.5.1) or if SVN just\ntruncates the zeroes...\n\n-- \nEric Wong\n"},{"id":"105366","messageId":"7vtz6rqmao.fsf@gitster.siamese.dyndns.org","threadId":"17850","inReplyTo":"20090217214914.GD26706@dcvr.yhbt.net","subject":"Re: git-svn error: Unable to parse date","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-02-19T00:53:51Z","receivedAt":"2009-02-19T00:53:51Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Wong <normalperson@yhbt.net> writes:\n\n> Yup.  Consider a patch with the quoted decimal point to be\n>   Acked-by: Eric Wong <normalperson@yhbt.net>\n\nThanks\n"}]}