git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tytso@mit.edu
To: kusmabite@gmail.com
Cc: Jeff King <peff@peff.net>, Jonathan Nieder <jrnieder@gmail.com>,
	jeffpc@josefsipek.net, Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH] guilt: Make sure the commit time is increasing
Date: Tue, 6 Jul 2010 13:21:09 -0400	[thread overview]
Message-ID: <20100706172109.GM25518@thunk.org> (raw)
In-Reply-To: <AANLkTikWGzEq8wiVyu_xJ-tK92N1oRFOrawjOe9UQXkr@mail.gmail.com>

On Tue, Jul 06, 2010 at 05:02:51PM +0200, Erik Faye-Lund wrote:
> 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

  reply	other threads:[~2010-07-06 17:21 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-05  2:23 [PATCH] guilt: Make sure the commit time is increasing Theodore Ts'o
2010-07-05  2:51 ` tytso
2010-07-05  3:01   ` jeffpc
2010-07-05  2:59 ` jeffpc
2010-07-05 11:06   ` Theodore Tso
2010-07-05 18:52     ` jeffpc
2010-07-05 19:22       ` tytso
2010-07-06  8:03         ` Jonathan Nieder
2010-07-06 10:56           ` Theodore Tso
2010-07-06 15:09             ` Jonathan Nieder
2010-07-06 17:12               ` tytso
2010-07-06 17:29                 ` Jonathan Nieder
2010-07-06 13:53           ` Erik Faye-Lund
2010-07-06 14:29             ` Jeff King
2010-07-06 15:02               ` Erik Faye-Lund
2010-07-06 17:21                 ` tytso [this message]
2010-07-06 17:29         ` jeffpc
2010-07-06 18:57           ` tytso
2010-07-14  3:01         ` Josef 'Jeff' Sipek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100706172109.GM25518@thunk.org \
    --to=tytso@mit.edu \
    --cc=git@vger.kernel.org \
    --cc=jeffpc@josefsipek.net \
    --cc=jrnieder@gmail.com \
    --cc=kusmabite@gmail.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).