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

Re: [PATCH] guilt: Make sure the commit time is increasing

From
Theodore Tso <tytso@mit.edu>
Date
Jul 5, 2010, 11:06 UTC
Message-ID
<67D0ABD4-BD1A-4B7A-B3EC-F48F21B5DD01@mit.edu>
In-Reply-To
<20100705025900.GQ22659@josefsipek.net>
On Jul 4, 2010, at 10:59 PM, jeffpc@josefsipek.net wrote:
> 
> Am I understanding this right?  You want the timestamps to be monotonically
> increasing?  

Yup, that's correct. In more modern versions of git most (all?) of the places that depend on the committer time of the child commit to be greater than the committer time of its parents have been relaxed to accept up to a day's worth of clock skew, but in the interests of "be conservative in what you send", strictly increasing seemed like the best thing to do.

> Is the +60 the most obvious choice?

It's somewhat arbitrary. I figured a minute increase between commits was more aesthetically pleasing than a second, 5 minutes, or an hour, which were some other deltas that previous versions of my patch used while I was experimenting.

> 
> Can I get an example of how git can get confused?

This first one is explicitly my/guilt's fault (and it's when I learned that I was causing problems by how I was using guilt in the ext4 tree):

http://kerneltrap.org/mailarchive/git/2010/4/22/28928/thread

In this thread we see how the clock skew gets in the way of an optimization that speeds up "git tag --contains" by over two orders of magnitude, but it gets screwed over by extreme clock skew. I suggested in that thread that if git is going to depend on it, then maybe "git commit" should either warn or error out if the git committer timestamp goes backwards --- and that's when I decided maybe I should offer up a patch to guilt to fix this, either before or instead of fixing up "git commit" to throw a warning/error:

http://www.spinics.net/lists/git/msg134307.html
Other threads:

http://kerneltrap.org/mailarchive/git/2010/4/8/27731/thread http://www.kerneltrap.com/mailarchive/git/2007/5/24/247375

-- Ted
Previous: jeffpc@josefsipek.netNext: jeffpc@josefsipek.net
Message 5 of 19 in “guilt: Make sure the commit time is increasing”
  1. guilt: Make sure the commit time is increasingTheodore Ts'o, Jul 5, 2010
  2. tytso@mit.eduJul 5, 2010
  3. jeffpc@josefsipek.netJul 5, 2010
  4. jeffpc@josefsipek.netJul 5, 2010
  5. Theodore TsoJul 5, 2010
  6. jeffpc@josefsipek.netJul 5, 2010
  7. tytso@mit.eduJul 5, 2010
  8. Jonathan NiederJul 6, 2010
  9. Theodore TsoJul 6, 2010
  10. Jonathan NiederJul 6, 2010
  11. tytso@mit.eduJul 6, 2010
  12. Jonathan NiederJul 6, 2010
  13. Erik Faye-LundJul 6, 2010
  14. Jeff KingJul 6, 2010
  15. Erik Faye-LundJul 6, 2010
  16. tytso@mit.eduJul 6, 2010
  17. jeffpc@josefsipek.netJul 6, 2010
  18. tytso@mit.eduJul 6, 2010
  19. Josef 'Jeff' SipekJul 14, 2010

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.