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

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

From
tytso@mit.edu <tytso@mit.edu>
Date
Jul 6, 2010, 17:21 UTC
Message-ID
<20100706172109.GM25518@thunk.org>
In-Reply-To
<AANLkTikWGzEq8wiVyu_xJ-tK92N1oRFOrawjOe9UQXkr@mail.gmail.com>
On Tue, Jul 06, 2010 at 05:02:51PM +0200, Erik Faye-Lund wrote:
Show 11 quoted lines
> But I can imagine it becoming a big deal when the skew is high. The
> again, perhaps this should constitute a "bad commit" and commit should
> error out if a parent commit was more than some number of minutes
> newer than the current time (or whatever)? That way, skewed commits
> would be caught early if a developer is working with other people, and
> a lot of the traversal could perhaps be faster (or more robust). If
> the developer with the skewed clock doesn't work with anyone, skew
> isn't really a problem, but perhaps he'd have to do some
> branch-filtering to un-skew commits when starting to work with others.
> And only if the skew is really high... like, multiple days... Which
> can't really be THAT common?

Guilt uses the modtime of the patch in a patch series for the committer time and the author time. The reasoning behind it doing this is so that you can do "git pop -a" followed by "git push -a" and if the patch files haven't changed, the commit id's don't change either.

But if you change a commit in the middle of the series, you can end up with clock skews that could be several days or weeks. Becuase of my ext4 workflow, the Linux kernel has a maximum skew of 100 days. Mea culpa; I stopped doing this as soon as I was told that git was depending on committer time being roughly increasing, and so I at least haven't introduced any such time skews since v2.6.34. And part of my making up for this has been to submit a patch to guilt to prevent this from happening again in the future, by fixing up guilt so that it won't request "git commit" to create timestamps that show very wild clock skews within a single linear branch.

We could still get potentially screwed though. Every so often I will see someone sending e-mail from a client host whose time is years if not decades in the past or in the future. If they were to do a "git commit", and then push that commit to a public repository, we could easily introduce a large clock skew into a git repo. Has that ever happened to date? Not to my knowledge. Could it happen? Very clearly, yes. Should we try to put in some safety checks to prevent it, or at least issue warnings? Maybe.

						- Ted
Previous: Erik Faye-LundNext: jeffpc@josefsipek.net
Message 16 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.