From: Junio C Hamano <gitster@pobox.com>
To: Daniel Ducharme <dducharme@catalisgov.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Bug in SVN.pm
Date: Mon, 11 Dec 2023 17:43:27 -0800 [thread overview]
Message-ID: <xmqqo7ewtcu8.fsf@gitster.g> (raw)
In-Reply-To: <DS7PR13MB46861D9FF40E2A340FD2C8D2CF8FA@DS7PR13MB4686.namprd13.prod.outlook.com> (Daniel Ducharme's message of "Mon, 11 Dec 2023 22:51:48 +0000")
Daniel Ducharme <dducharme@catalisgov.com> writes:
> sub parse_svn_date requires both the month, day, hour, and minute
> to be 2 digits long and fails on 2007-3-12T17:46:4.000000Z as an
> example due to the regex. Suggestion is to make the regex instead
> /^(\d{4})\-(\d\d?)\-(\d\d?)T (\d\d?)\:(\d\d?)\:(\d\d?)\.\d*Z$/x)
>
> I have found this data to be present in a SVN repository converted
> off of VSS while trying to take some old VSS repos to git through
> SVN, not sure if standard SVN would have allowed these date
> patterns, but they should be valid. The above regex also contains
> a fix for single digit minute and second as I also ran into that
> as well.
I do not think it is fair to call this a bug in SVN.pm, provided if
SVN wants to use ISO 8601 datetime format for its timestamps. ISO
8601, IIUC, is fairly clear that month and day must be two-digit
strings, 0-filled to the left as needed, and I would not be
surprised if standard SVN rejected such bogus dates, and I do not
agree with your "they *SHOULD* be valid" statement.
Having said all that, it is good to be liberal in what we accept,
and I am sympathetic to "it would be nicer if they were accepted"
sentiment. As long as there is no ambiguity, I would say that it
would be nicer if timestamps like "2007-3-12T17:1:2.0Z" were
accepted, and I would not be fundamentally opposed to a patch that
loosens the regex to do so.
Patches welcome ;-).
prev parent reply other threads:[~2023-12-12 1:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-11 22:51 Bug in SVN.pm Daniel Ducharme
2023-12-12 1:43 ` Junio C Hamano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqo7ewtcu8.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=dducharme@catalisgov.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.