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

Re: git-fast-import

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Feb 6, 2007, 17:20 UTC
Message-ID
<Pine.LNX.4.64.0702060913220.8424@woody.linux-foundation.org>
In-Reply-To
<20070206165630.GB4949@spearce.org>
On Tue, 6 Feb 2007, Shawn O. Pearce wrote:
Show 5 quoted lines
> 
> If the source is only supplying RFC2822 date format and is reliable
> in its formatting of such, having gfi parse that rather than
> the frontend is probably more reliable.  (Git already has a well
> tested date parsing routine.)

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.

And we'd never even see it, because gits date-parsing routines are very forgiving, and allow pretty much anything (and no, I'm not talking about approxidate(), which really *does* allow anything, I'm talking about the "strict" date parser).

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

And *particularly* when it comes to timezones, it just guesses. The whole daylight savings time thing is just too hard. And if no timezone exists, it will just take the current one, so things may *seem* like they work, but then two different people importing the *same* archive in two different locations will actually get different results!

THAT'S A BAD THING!

It's much better to specify the date so exactly that you simply cannot get different results with the same input.

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.

And the TZ problem is actually less likely if you have a strict TZ format. For example, when importing from CVS, the natural thing to do is to just always set TZ to +0000. Which gets you something reliable, and it won't depend on who did the import.

But hey, especially if it's a flag, and especially if it's *documented* that the date parsing will depend on the current timezone etc, then maybe it's all ok. It's certainly convenient to be able to give the date in any format. It's just very easy to get bugs when you allow any random crud..

		Linus
Previous: Shawn O. PearceNext: Nicolas Pitre
Message 7 of 49 in “git-fast-import”
  1. Shawn O. PearceFeb 6, 2007
  2. Nicolas PitreFeb 6, 2007
  3. Nicolas PitreFeb 6, 2007
  4. Shawn O. PearceFeb 6, 2007
  5. Linus TorvaldsFeb 6, 2007
  6. Shawn O. PearceFeb 6, 2007
  7. Linus TorvaldsFeb 6, 2007
  8. Nicolas PitreFeb 6, 2007
  9. Shawn O. PearceFeb 6, 2007
  10. Nicolas PitreFeb 6, 2007
  11. Shawn O. PearceFeb 6, 2007
  12. Nicolas PitreFeb 6, 2007
  13. David WoodhouseFeb 7, 2007
  14. Aneesh Kumar K.VFeb 6, 2007
  15. Shawn O. PearceFeb 6, 2007
  16. Daniel BarkalowFeb 7, 2007
  17. Karl HasselströmFeb 7, 2007
  18. Johannes SchindelinFeb 7, 2007
  19. Shawn O. PearceFeb 7, 2007
  20. Johannes SchindelinFeb 7, 2007
  21. Shawn O. PearceFeb 8, 2007
  22. Linus TorvaldsFeb 8, 2007
  23. Shawn O. PearceFeb 8, 2007
  24. Karl HasselströmFeb 9, 2007
  25. Linus TorvaldsFeb 9, 2007
  26. Raimund BauerFeb 7, 2007
  27. David WoodhouseFeb 7, 2007
  28. Andy ParkinsFeb 6, 2007
  29. Shawn O. PearceFeb 6, 2007
  30. Linus TorvaldsFeb 6, 2007
  31. Shawn O. PearceFeb 6, 2007
  32. Linus TorvaldsFeb 6, 2007
  33. Horst H. von BrandFeb 7, 2007
  34. Linus TorvaldsFeb 7, 2007
  35. Shawn O. PearceFeb 7, 2007
  36. Karl HasselströmFeb 7, 2007
  37. Horst H. von BrandFeb 7, 2007
  38. Jakub NarebskiFeb 7, 2007
  39. Linus TorvaldsFeb 7, 2007
  40. Johannes SchindelinFeb 8, 2007
  41. Shawn O. PearceFeb 7, 2007
  42. Daniel BarkalowFeb 7, 2007
  43. Jakub NarebskiFeb 6, 2007
  44. Shawn O. PearceFeb 6, 2007
  45. Jakub NarebskiFeb 6, 2007
  46. Shawn O. PearceFeb 6, 2007
  47. Alex RiesenFeb 6, 2007
  48. Shawn O. PearceFeb 6, 2007
  49. Alex RiesenFeb 6, 2007

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.