git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Jeff King <peff@peff.net>, git@vger.kernel.org
Subject: Re: [RFH] revision limiting sometimes ignored
Date: Tue, 05 Feb 2008 15:44:29 -0800	[thread overview]
Message-ID: <7vprvb6k9u.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: alpine.LFD.1.00.0802051300050.3110@woody.linux-foundation.org

Linus Torvalds <torvalds@linux-foundation.org> writes:

> I really wonder if the right thing is not simply to admit that we consider 
> the commit time meaningful (within some fudge factor!), and then do:
>
>  - make commit warn if any parent commit date is in the future from the 
>    current commit date (allow a *small* fudge factor here, say 5 minutes).

Hmmm.  In other words, you are punished for trying to build on
top of somebody else who screwed up.  That sucks.

>  - teach fsck to complain about parent commits being in the future from 
>    their children (allow the same small fudge factor).

And this is even worse.

But I think these are sane thing to do regardless.  To prevent
problematic commits from contaminating other people, we could
add default post-receive hook and perhaps a new pre-merge hook
to inspect the newly obtained history to warn and reject a merge
(including fast-forward) if it contains commits far into the
future.  We would also need a mechanism to force a merge with
such a clock-skewed history if we did so.

>  - make the revision walking code realize that if times are too close to 
>    each other, it should walk a bit further back...
>
> because quite frankly, this bug only shows up when your time goes 
> backwards (or stays the same, but the fudge-factor should take care of 
> that too).

> @@ -579,6 +581,15 @@ static int limit_list(struct rev_info *revs)
>  			return -1;
>  		if (obj->flags & UNINTERESTING) {
>  			mark_parents_uninteresting(commit);
> +
> +			/*
> +			 * If we have commits on the newlist, we don't
> +			 * want to do the "everybody_uninteresting()"
> +			 * test until we've hit a negative commit that
> +			 * is solidly in the past
> +			 */
> +			if (newlist && newlist->item->date < commit->date + FUDGE)
> +				continue;
>  			if (everybody_uninteresting(list))
>  				break;
>  			continue;

We picked up commit which we know is the youngest in the "list".
Because we push into newlist as we traverse, newlist is sorted
by date, and the element pointed by it is the youngest in there.
That is something we have processed earlier, so it ought to be
younger than this commit.  Otherwise we have found a problematic
clock skew.  Ok, I think it should work.

The clock skew t6009 artificially introduces needs to be
shortened for this, though.

  parent reply	other threads:[~2008-02-06  0:35 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-02 12:21 [BUG?] git log picks up bad commit Tilman Sauerbeck
2008-02-03  3:00 ` Jeff King
2008-02-03  4:33   ` [RFH] revision limiting sometimes ignored Jeff King
2008-02-03  6:24     ` Junio C Hamano
2008-02-03  6:39     ` Junio C Hamano
2008-02-03  7:13       ` Jeff King
2008-02-03  7:18         ` Jeff King
2008-02-03  7:40           ` Junio C Hamano
2008-02-03  7:47             ` Junio C Hamano
2008-02-03  8:18           ` Junio C Hamano
2008-02-04 17:32     ` Linus Torvalds
2008-02-04 17:37       ` Linus Torvalds
2008-02-04 19:08       ` Junio C Hamano
2008-02-04 20:03         ` Linus Torvalds
2008-02-04 20:06           ` Linus Torvalds
2008-02-04 20:50           ` Linus Torvalds
2008-02-05  7:14             ` Junio C Hamano
2008-02-05 21:23               ` Linus Torvalds
2008-02-05 22:34                 ` Johannes Schindelin
2008-02-05 23:59                   ` Linus Torvalds
2008-02-06 16:43                     ` Tilman Sauerbeck
2008-02-06 17:28                       ` Nicolas Pitre
2008-02-06 17:42                         ` Linus Torvalds
2008-02-06 17:48                           ` Nicolas Pitre
2008-02-06 19:26                       ` Linus Torvalds
2008-02-06  1:22                   ` Nicolas Pitre
2008-02-06  1:51                   ` Junio C Hamano
2008-02-06  6:05                     ` Junio C Hamano
2008-02-06  6:17                       ` Junio C Hamano
2008-02-05 23:44                 ` Junio C Hamano [this message]
2008-02-06  0:52                   ` Linus Torvalds
2008-02-06  5:30                     ` Junio C Hamano
2008-02-06  8:16                       ` Karl Hasselström
2008-02-06 10:34                       ` Linus Torvalds

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=7vprvb6k9u.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    --cc=torvalds@linux-foundation.org \
    /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).