From: Nicolas Pitre <nico@cam.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: "Shawn O. Pearce" <spearce@spearce.org>, git@vger.kernel.org
Subject: Re: git-fast-import
Date: Tue, 06 Feb 2007 13:53:37 -0500 (EST) [thread overview]
Message-ID: <Pine.LNX.4.64.0702061329090.19212@xanadu.home> (raw)
In-Reply-To: <Pine.LNX.4.64.0702060913220.8424@woody.linux-foundation.org>
On Tue, 6 Feb 2007, Linus Torvalds wrote:
> I'm not so worried about the git date parsing routines (which are fairly
> solid) as about the fact that absolutely *tons* of people get rfc2822
> wrong.
>
> They allow pretty much any half-way valid date, exactly because people
> don't do rfc2822 right anyway (and because they are also meant to work
> even if you write the date by hand, like "12:34 2005-06-07").
>
> Sure, you can still mess up the program that actually generates the data
> for gfi, and have bugs like that *there*, but at least they'd have to
> think a bit about it.
Well, exactly because GIT already has fairly solid date parsing
routines, and the fact that we needed solid date parsing routines in the
first place, exactly because people don't do rfc2822 right anyway,
should be a hell of a big clue why we should parse date information for
the gfi frontend. Because the date is for sure most likely in a screwed
up format already and it is counter productive to have to deal with that
in a duplicated piece of code. And the bare reality is that people will
just not care to parse it right themselves.
Quoting from the gfi manual:
|A typical frontend for gfi tends to weigh in at approximately 200
|lines of Perl/Python/Ruby code. Most developers have been able to
|create working importers in just a couple of hours, even though it
|is their first exposure to gfi, and sometimes even to Git. This is
|an ideal situation, given that most conversion tools are throw-away
|(use once, and never look back).
This is therefore a damn good idea if gfi can make things right out of
crap because frontends will not get much attention after the first "hey
it works" level. And the GIT date format, albeit being perfectly
unambigous, is not inline with the statement above.
With the GIT date format a conversion _will_ be necessary in the
frontend, while if gfi shove it to parse_date() instead then no
conversion is even likely to be needed by the frontend. I'd much prefer
if frontend writers didn't have to care (and most probably manage to
botch it if they have to) about date conversion. We even botched it a
few times ourselves despite the fact that we're damn good.
And because our date parsing code is damn good (hey we're just damn good
aren't we?) I would bet that there will be much less conversion errors
if gfi used parse_date() on provided data than if the frontend tries to
parse the date itself. This is wat we feed email submission through
everyday anyway, so we must trust it to do a good job for imports as
well.
Nicolas
next prev parent reply other threads:[~2007-02-06 18:54 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-06 2:31 git-fast-import Shawn O. Pearce
2007-02-06 3:18 ` git-fast-import Nicolas Pitre
2007-02-06 4:06 ` git-fast-import Nicolas Pitre
2007-02-06 5:48 ` git-fast-import Shawn O. Pearce
2007-02-06 16:35 ` git-fast-import Linus Torvalds
2007-02-06 16:56 ` git-fast-import Shawn O. Pearce
2007-02-06 17:20 ` git-fast-import Linus Torvalds
2007-02-06 18:53 ` Nicolas Pitre [this message]
2007-02-06 20:09 ` git-fast-import Shawn O. Pearce
2007-02-06 21:03 ` git-fast-import Nicolas Pitre
2007-02-06 21:15 ` git-fast-import Shawn O. Pearce
2007-02-06 21:42 ` git-fast-import Nicolas Pitre
2007-02-07 10:58 ` git-fast-import David Woodhouse
2007-02-06 6:12 ` git-fast-import Aneesh Kumar K.V
2007-02-06 6:18 ` git-fast-import Shawn O. Pearce
2007-02-07 4:55 ` git-fast-import Daniel Barkalow
2007-02-07 9:13 ` git-fast-import Karl Hasselström
2007-02-07 11:17 ` git-fast-import Johannes Schindelin
2007-02-07 22:55 ` git-fast-import Shawn O. Pearce
2007-02-07 23:55 ` git-fast-import Johannes Schindelin
2007-02-08 0:12 ` git-fast-import Shawn O. Pearce
2007-02-08 16:56 ` git-fast-import Linus Torvalds
2007-02-08 19:10 ` git-fast-import Shawn O. Pearce
2007-02-09 8:49 ` git-fast-import Karl Hasselström
2007-02-09 15:47 ` git-fast-import Linus Torvalds
2007-02-07 9:29 ` git-fast-import Raimund Bauer
2007-02-07 13:38 ` git-fast-import David Woodhouse
2007-02-06 9:28 ` git-fast-import Andy Parkins
2007-02-06 9:40 ` git-fast-import Shawn O. Pearce
2007-02-06 16:37 ` git-fast-import Linus Torvalds
2007-02-06 16:44 ` git-fast-import Shawn O. Pearce
2007-02-06 17:24 ` git-fast-import Linus Torvalds
2007-02-07 1:17 ` git-fast-import Horst H. von Brand
2007-02-07 2:50 ` git-fast-import Linus Torvalds
2007-02-07 5:53 ` git-fast-import Shawn O. Pearce
2007-02-07 9:21 ` git-fast-import Karl Hasselström
2007-02-07 22:18 ` git-fast-import Horst H. von Brand
2007-02-07 22:31 ` git-fast-import Jakub Narebski
2007-02-07 22:39 ` git-fast-import Linus Torvalds
2007-02-08 21:34 ` git-fast-import Johannes Schindelin
2007-02-07 5:46 ` git-fast-import Shawn O. Pearce
2007-02-07 4:45 ` git-fast-import Daniel Barkalow
2007-02-06 9:34 ` git-fast-import Jakub Narebski
2007-02-06 9:39 ` git-fast-import Shawn O. Pearce
2007-02-06 9:53 ` git-fast-import Jakub Narebski
2007-02-06 17:20 ` git-fast-import Shawn O. Pearce
2007-02-06 13:50 ` git-fast-import Alex Riesen
2007-02-06 17:43 ` git-fast-import Shawn O. Pearce
2007-02-06 18:02 ` git-fast-import Alex Riesen
-- strict thread matches above, loose matches on Subject: below --
2006-08-06 2:51 git-fast-import Jon Smirl
2006-08-06 3:40 ` git-fast-import Shawn Pearce
2006-08-06 4:09 ` git-fast-import Jon Smirl
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=Pine.LNX.4.64.0702061329090.19212@xanadu.home \
--to=nico@cam.org \
--cc=git@vger.kernel.org \
--cc=spearce@spearce.org \
--cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).