Re: [RFH] revision limiting sometimes ignored

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Junio C Hamano <gitster@...>
Cc: Jeff King <peff@...>, <git@...>
Date: Tuesday, February 5, 2008 - 5:23 pm

On Mon, 4 Feb 2008, Junio C Hamano wrote:

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).

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

 - 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).

So the revision walking "fudge factor" could be as simple as the 
following..

		Linus

---
 revision.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/revision.c b/revision.c
index 6e85aaa..e32e1e3 100644
--- a/revision.c
+++ b/revision.c
@@ -558,6 +558,8 @@ static void cherry_pick_list(struct commit_list *list, struct rev_info *revs)
 	free_patch_ids(&ids);
 }
 
+#define FUDGE (60*60)	/* 1 hour fudge-factor */
+
 static int limit_list(struct rev_info *revs)
 {
 	struct commit_list *list = revs->commits;
@@ -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;
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[BUG?] git log picks up bad commit, Tilman Sauerbeck, (Sat Feb 2, 8:21 am)
Re: [BUG?] git log picks up bad commit, Jeff King, (Sat Feb 2, 11:00 pm)
[RFH] revision limiting sometimes ignored, Jeff King, (Sun Feb 3, 12:33 am)
Re: [RFH] revision limiting sometimes ignored, Linus Torvalds, (Mon Feb 4, 1:32 pm)
Re: [RFH] revision limiting sometimes ignored, Junio C Hamano, (Mon Feb 4, 3:08 pm)
Re: [RFH] revision limiting sometimes ignored, Linus Torvalds, (Mon Feb 4, 4:03 pm)
Re: [RFH] revision limiting sometimes ignored, Linus Torvalds, (Mon Feb 4, 4:50 pm)
Re: [RFH] revision limiting sometimes ignored, Junio C Hamano, (Tue Feb 5, 3:14 am)
Re: [RFH] revision limiting sometimes ignored, Linus Torvalds, (Tue Feb 5, 5:23 pm)
Re: [RFH] revision limiting sometimes ignored, Johannes Schindelin, (Tue Feb 5, 6:34 pm)
Re: [RFH] revision limiting sometimes ignored, Junio C Hamano, (Tue Feb 5, 9:51 pm)
Re: [RFH] revision limiting sometimes ignored, Junio C Hamano, (Wed Feb 6, 2:05 am)
Re: [RFH] revision limiting sometimes ignored, Junio C Hamano, (Wed Feb 6, 2:17 am)
Re: [RFH] revision limiting sometimes ignored, Nicolas Pitre, (Tue Feb 5, 9:22 pm)
Re: [RFH] revision limiting sometimes ignored, Linus Torvalds, (Tue Feb 5, 7:59 pm)
Re: [RFH] revision limiting sometimes ignored, Tilman Sauerbeck, (Wed Feb 6, 12:43 pm)
Re: [RFH] revision limiting sometimes ignored, Linus Torvalds, (Wed Feb 6, 3:26 pm)
Re: [RFH] revision limiting sometimes ignored, Nicolas Pitre, (Wed Feb 6, 1:28 pm)
Re: [RFH] revision limiting sometimes ignored, Linus Torvalds, (Wed Feb 6, 1:42 pm)
Re: [RFH] revision limiting sometimes ignored, Nicolas Pitre, (Wed Feb 6, 1:48 pm)
Re: [RFH] revision limiting sometimes ignored, Linus Torvalds, (Mon Feb 4, 4:06 pm)
Re: [RFH] revision limiting sometimes ignored, Linus Torvalds, (Mon Feb 4, 1:37 pm)
Re: [RFH] revision limiting sometimes ignored, Junio C Hamano, (Sun Feb 3, 2:39 am)
Re: [RFH] revision limiting sometimes ignored, Jeff King, (Sun Feb 3, 3:13 am)
Re: [RFH] revision limiting sometimes ignored, Jeff King, (Sun Feb 3, 3:18 am)
Re: [RFH] revision limiting sometimes ignored, Junio C Hamano, (Sun Feb 3, 4:18 am)
Re: [RFH] revision limiting sometimes ignored, Junio C Hamano, (Sun Feb 3, 3:40 am)
Re: [RFH] revision limiting sometimes ignored, Junio C Hamano, (Sun Feb 3, 3:47 am)
Re: [RFH] revision limiting sometimes ignored, Junio C Hamano, (Sun Feb 3, 2:24 am)