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

Re: [PATCH] Update SVN.pm

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 17, 2014, 18:01 UTC
Message-ID
<xmqqoazzesyi.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20140416141605.GA9692@camelia.ucw.cz>
Stepan Kasal <kasal@ucw.cz> writes:
Show 11 quoted lines
> From: RomanBelinsky <belinsky.roman@gmail.com>
> Date: Tue, 11 Feb 2014 18:23:02 +0200
>
> fix parsing error for dates like:
> 2014-01-07T5:58:36.048176Z
> previous regex can parse only:
> 2014-01-07T05:58:36.048176Z
> reproduced in my svn repository during conversion.
>
> Signed-off-by: Stepan Kasal <kasal@ucw.cz>
> ---
Two niggles.
 - The "Subject" line is not descriptive enough to let readers of "git
   shortlog" know what this change is about.
 - Can we have the patch signed-off by the author?

For the first point, I'd suggest rewriting the proposed commit message like this (this is what I came up with after reading that msysgit discussion page you referred to in the other message):

------------------------------------------------------ SVN.pm::parse_svn_date: allow timestamps with a single-digit hour

Some broken subversion server gives timestamps with only one digit in the hour part, like this:

    2014-01-07T5:58:36.048176Z

Loosen the regexp that expected to see two-digit hour, minute and second parts to accept a single-digit hour (but not minute or second).

Signed-off-by: Stepan Kasal <kasal@ucw.cz>
------------------------------------------------------
Show 15 quoted lines
>  perl/Git/SVN.pm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/perl/Git/SVN.pm b/perl/Git/SVN.pm
> index a59564f..09cff13 100644
> --- a/perl/Git/SVN.pm
> +++ b/perl/Git/SVN.pm
> @@ -1321,7 +1321,7 @@ sub get_untracked {
>  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";
>  	my $parsed_date;    # Set next.
Previous: Stepan Kasal
Message 6 of 6 in “Update SVN.pm”
  1. Update SVN.pmStepan Kasal, Apr 16, 2014
  2. Junio C HamanoApr 16, 2014
  3. Stepan KasalApr 17, 2014
  4. Junio C HamanoApr 17, 2014
  5. Stepan KasalApr 18, 2014
  6. Junio C HamanoApr 17, 2014

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.