All of lore.kernel.org
 help / color / mirror / Atom feed
* Bug in SVN.pm
@ 2023-12-11 22:51 Daniel Ducharme
  2023-12-12  1:43 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Ducharme @ 2023-12-11 22:51 UTC (permalink / raw)
  To: git

Good afternoon,

Not sure if this is maintained as part of GIT, but the bug is located in the file: C:\Program Files\Git\mingw64\share\perl5\Git\SVN.pm

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 have fixed my local copy so I am good for my project, but it took me a couple of hours to find and fix and figured this may help someone else so I wanted to get it reported. I am on git version 2.43.0.windows.1.

Daniel   Ducharme, Ph.D., RICA l  Director of Software Development
Catalis Tax and CAMA, Inc.
O: 781.476.2012
M: 401.743.5853
E: dducharme@catalisgov.com
 catalisgov.com


 


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Bug in SVN.pm
  2023-12-11 22:51 Bug in SVN.pm Daniel Ducharme
@ 2023-12-12  1:43 ` Junio C Hamano
  0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2023-12-12  1:43 UTC (permalink / raw)
  To: Daniel Ducharme; +Cc: git

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-12-12  1:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-11 22:51 Bug in SVN.pm Daniel Ducharme
2023-12-12  1:43 ` Junio C Hamano

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.