Re: git-svn error: Unable to parse date

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ward Wouts <ward@xxxxxxxx> 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.

> 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.

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.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux