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

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

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Jul 6, 2010, 15:09 UTC
Message-ID
<20100706150917.GA1558@burratino>
In-Reply-To
<DD1E6EE4-1196-4FCA-87DA-EB9EBCA3AC83@mit.edu>
Theodore Tso wrote:
> You're right that it's been a while since git has run into problems with 
> mild forms of clock skew (even Debian Stable is shipping v1.5.6) but
> I think it's better to times in the future if we can at all help it, and it's not
> like we're talking about a lot of extra complexity to guilt to test for this.

Sorry, I’m a little lost. There are five phenomena one could forbid:

 1. Commits with timestamp equal to or before a parent
 2. Commits with timestamp before a parent
 3. Commits with timestamp unreasonably long before a parent
 4. Commits with timestamp unreasonably long before an ancestor
 5. Commits with timestamp in the future

Git has always been able to cope with #5 (timestamps in the future). I see no reason to avoid it, except that it is hard to assign a timestamp for commits on top of that one.

Git’s problem today is #4 (long-term slop). Maybe as Jeff suggested "unreasonably long" should defined per repository. Or we could measure the kernel’s maximum (something like 120 days?) and make that a hard limit.

Do #3 a few times, and you get #4. So ‘commit’ should warn about it (where ‘unreasonably long’ could be as short as 0 or 1 days).

#2 (nonmonotonic commits) was broken in ancient git; I think it’s too rigid of a rule to worry about it on that account. But a variant of the rationale for avoiding #3 applies to it.

I have never heard of any version of Git copying poorly with #1 (commits with the same timestamp). Avoiding it artificially leads inevitably to timestamps in the future when you somehow try to assign 100 timestamps for the series you have rebased on top of a patch committed a few seconds ago.

Incrementing the timestamp to ensure strictly monotonic commits seems like a recipe for trouble to me.

For guilt, I think the best thing to do would to save a Date: line for the author date with the From: and Subject: and then touch patches with the _current_ date when appropriate to avoid skew.

HTH, Jonathan

Previous: Theodore TsoNext: tytso@mit.edu
Message 10 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.