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

Re: git and time

From
Theodore Tso <tytso@mit.edu>
Date
Sep 28, 2006, 01:36 UTC
Message-ID
<20060928013611.GC7469@thunk.org>
In-Reply-To
<20060928001241.62887.qmail@web51013.mail.yahoo.com>
On Wed, Sep 27, 2006 at 05:12:41PM -0700, Matthew L Foster wrote:
Show 5 quoted lines
> 
> Ignoring the separate issue of replication for a momment, can
> someone respond to my time integrity question about whether a future
> version of git could trust/prefer its local time rather than a
> remote/sub/parent (non replicated) git server's timestamp? 

No, it can't. In order to do that it would have to change the commit, and that would be rewriting history.

Consider a more complicated case of replication, where git is used exclusively, so that a patch gets commited by developer A, pushed to device driver maintainer B, which then gets pushed to subsystem maintainer C, which then pushed to Linus's private tree, and then Linus pushes it to the publically visible repository. Now assume for the sake of argument that developers A, B, and C all keep publically visible repositories, all of which are accessible via gitweb.cgi, and assume for the sake of argument that the patch is pushed exclusively via git.

In that case, the time that the changeset was made is the time that developer A created the commit. That is, of course, the time on his local machine, which may or may not be accurate. And of course, the e-mail address which he gives may or may not be accurate as well. There can be no integrity guarantees because we are not using cryptography. There are no time notaries, no public key signatures. Both the time and the author name/e-mail are merely metadata which is attached to the patch, and the time, author name/e-mail, and patch are hashed together to form a SHA checksum of the commit. So while we don't have any kind of assurance about the time or author e-mail, what we *do* have is an assurance that a commit's name --- which is the SHA checksum --- refers to a specific patch, and with a specific claimed timestamp and claimed e-mail name. So if we refer to a particular commit by that SHA hash value, we do know globally that we are always referring to the same commit. Changing the time would change the SHA hash, which would make it impossible for two machines to know whether or not a commit is the same or not.

More to the point, that particular commit will travel from developer A, to B, to C, to Linus, to public repository on master.kernel.org. During that whole time, it is invariant. It cannot change, including the commit timestamp. Now, at each stage, as the patch gets pushed along, all of the information ---- the patch itself, the claimed time, and the claimed author date --- are used to evalute the patch and decide whether or not the patch should be pushed higher up the trust hierarchy. In Linus, the most important thing which is used is an evaluation of the patch itself. If the patch is good, the fact that the commit time might be six months in the past isn't necessarily a problem.

And of course, the commit time might be *right*. It could be that developer A did do the work six months ago, but merely sat on it for a while before submitting it to maintainer B, and maybe maintainer B sat on it because rc1 had passed and he was being a good doobie and not forwarding patches on so that tree could stablize, and by the time rc7 was released, he had gotten tired of waiting, so pushed it on to lieutenant C, and it finally got pushed to Linus after 2.6.18 was released, many months later.

Show 5 quoted lines
> How do we fix gitweb.cgi, ref-log? 
> How useful is gitweb.cgi if timestamps are
> all over the place? It does not make sense that commit order is
> currently out of sync with time order in the main linux kernel tree
> git repo on kernel.org. 

Your problem is that you are putting too much faith in the time stamp. It's there as a help, but it is no more trustworthy than the author name or the patch description --- which is to say, if people in the git hierarchy are happy with the commit, it will get pushed, and if they aren't it won't. And most people don't care about the time; they care about whether the patch is correct. Now, the time is mostly correct, so if you look at the patch dependencies you can usually determine when a patch was likely committed to the first local repoistory to within a few hours in all likelihood.

Now, I could imagine a system where every changeset also had metadata associated with it that involved a receipt from a time notary, and a digital signature so that each patch could be cryptographically shown to have come form some individual (or at least someone who posses that particular individual's key). This would add a lot more overhead to the SCM, but at least it's theoretically possible. The question is it worth it?

At least within the Linux commmunity, the most important thing is whether or not the patch is good, not whether it is cryptographically signed by some particular developer. And times are considered even less important --- and given that a time notary is complex, and requires out of band facilities such as publishing lists of checksums and checksums of checksums in publically norepudiable places such as classifie dadds in the New York Times, LA Times, and Washington Post, it won't be something which is zero cost, either. And given that no one cares enough about times to spend that kind of resources, I very much doubt git will ever support time notary support.

> Why must each and every repo be dependent on
> time being set properly on all other git servers? 
They don't.
> How useful is change history or commit order without some concept of
> (local) time order?
Very useful.  :-)
							- Ted
Previous: Junio C HamanoNext: Matthew L Foster
Message 50 of 115 in “git and time”
  1. Matthew L FosterSep 26, 2006
  2. Johannes SchindelinSep 26, 2006
  3. Jakub NarebskiSep 26, 2006
  4. Jeff KingSep 26, 2006
  5. Matthew L FosterSep 27, 2006
  6. SeanSep 27, 2006
  7. David LangSep 27, 2006
  8. SeanSep 27, 2006
  9. Junio C HamanoSep 27, 2006
  10. David LangSep 27, 2006
  11. SeanSep 27, 2006
  12. Junio C HamanoSep 27, 2006
  13. SeanSep 27, 2006
  14. Junio C HamanoSep 27, 2006
  15. Andreas EricssonSep 27, 2006
  16. Jeff KingSep 27, 2006
  17. Matthew L FosterSep 27, 2006
  18. Andreas EricssonSep 27, 2006
  19. Matthew L FosterSep 27, 2006
  20. Linus TorvaldsSep 27, 2006
  21. Matthew L FosterSep 27, 2006
  22. Linus TorvaldsSep 27, 2006
  23. Matthew L FosterSep 27, 2006
  24. Linus TorvaldsSep 27, 2006
  25. Matthew L FosterSep 27, 2006
  26. Linus TorvaldsSep 27, 2006
  27. Matthew L FosterSep 27, 2006
  28. Linus TorvaldsSep 27, 2006
  29. Shawn PearceSep 27, 2006
  30. Linus TorvaldsSep 27, 2006
  31. Matthew L FosterSep 28, 2006
  32. Jeff KingSep 28, 2006
  33. Shawn PearceSep 28, 2006
  34. Matthew L FosterSep 28, 2006
  35. Linus TorvaldsSep 28, 2006
  36. Andreas EricssonSep 29, 2006
  37. Johannes SchindelinSep 29, 2006
  38. Andreas EricssonSep 29, 2006
  39. Junio C HamanoSep 28, 2006
  40. Matthew L FosterSep 28, 2006
  41. SeanSep 28, 2006
  42. Matthew L FosterSep 28, 2006
  43. David LangSep 28, 2006
  44. SeanSep 28, 2006
  45. Tom PrinceSep 28, 2006
  46. Nicolas PitreSep 28, 2006
  47. Tom PrinceSep 28, 2006
  48. Shawn PearceSep 28, 2006
  49. Junio C HamanoSep 28, 2006
  50. Theodore TsoSep 28, 2006
  51. Matthew L FosterSep 28, 2006
  52. Nicolas PitreSep 28, 2006
  53. Junio C HamanoSep 28, 2006
  54. Nicolas PitreSep 28, 2006
  55. Junio C HamanoSep 28, 2006
  56. Junio C HamanoSep 29, 2006
  57. Shawn PearceSep 30, 2006
  58. Junio C HamanoSep 30, 2006
  59. Linus TorvaldsSep 30, 2006
  60. Junio C HamanoSep 30, 2006
  61. Linus TorvaldsOct 1, 2006
  62. Junio C HamanoOct 1, 2006
  63. Junio C HamanoOct 1, 2006
  64. Johannes SchindelinOct 1, 2006
  65. Jakub NarebskiOct 2, 2006
  66. Jakub NarebskiSep 29, 2006
  67. Shawn PearceSep 27, 2006
  68. Matthew L FosterSep 27, 2006
  69. Shawn PearceSep 27, 2006
  70. Andy WhitcroftSep 27, 2006
  71. Linus TorvaldsSep 27, 2006
  72. Edgar ToernigSep 27, 2006
  73. Linus TorvaldsSep 27, 2006
  74. Jakub NarebskiSep 29, 2006
  75. Linus TorvaldsSep 27, 2006
  76. Jakub NarebskiOct 3, 2006
  77. Jeff KingSep 27, 2006
  78. SeanSep 27, 2006
  79. Junio C HamanoSep 27, 2006
  80. SeanSep 27, 2006
  81. Shawn PearceSep 27, 2006
  82. Junio C HamanoSep 27, 2006
  83. Junio C HamanoSep 27, 2006
  84. Shawn PearceSep 27, 2006
  85. Junio C HamanoSep 27, 2006
  86. Shawn PearceSep 27, 2006
  87. Jeff KingSep 27, 2006
  88. SeanSep 27, 2006
  89. Theodore TsoSep 28, 2006
  90. Matthew L FosterSep 28, 2006
  91. Rogan DawesSep 28, 2006
  92. Matthew L FosterSep 28, 2006
  93. Linus TorvaldsSep 28, 2006
  94. Junio C HamanoSep 28, 2006
  95. Matthew L FosterSep 28, 2006
  96. Johannes SchindelinSep 28, 2006
  97. Matthew L FosterSep 28, 2006
  98. Shawn PearceSep 28, 2006
  99. Matthew L FosterSep 28, 2006
  100. Johannes SchindelinSep 28, 2006
  101. Matthew L FosterSep 28, 2006
  102. Andreas EricssonSep 29, 2006
  103. Linus TorvaldsSep 28, 2006
  104. Matthew L FosterSep 28, 2006
  105. Theodore TsoSep 29, 2006
  106. Matthew L FosterSep 29, 2006
  107. Junio C HamanoSep 29, 2006
  108. Robin RosenbergSep 28, 2006
  109. A Large Angry SCMSep 28, 2006
  110. Matthew L FosterSep 28, 2006
  111. A Large Angry SCMSep 28, 2006
  112. Matthew L FosterSep 28, 2006
  113. Matthew L FosterSep 28, 2006
  114. Jan HarkesSep 29, 2006
  115. SeanSep 29, 2006

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.