Re: [RFH] revision limiting sometimes ignored

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Linus Torvalds <torvalds@...>
Cc: Johannes Schindelin <Johannes.Schindelin@...>, Jeff King <peff@...>, <git@...>
Date: Wednesday, February 6, 2008 - 2:05 am

Junio C Hamano <gitster@pobox.com> writes:


After exiting the while (list) we need to prove that each
positive commit in "newlist" cannot be reached by any of the
negative commit still in "list".

Even though "newlist" may have thousands of commits, we do not
have to inspect all of them.  In order to prove that we
traversed everything that matters, we will only need to look at
the ones whose ancestors are not in "newlist" (bottom commits)
and see if each of them can be reached from the negative ones.
If a non-bottom commit is reachable from one of the negative
ones, then the bottom commit that is ancestor of that non-bottom
commit surely is reachable as well.

We can make one pass to mark everything on "newlist" with one
bit from flags, and then another pass to mark the positive ones
whose parent has that bit set, so we would need two bits in
total while finding out the set of bottom commits (we can reuse
these two bits after we know what they are).

Once we find the set of bottom commits in "newlist", we would
need to prove that none of them can be reached from any of the
negative commits still in "list".  We can do this traversal
using two bits from flags, exactly like commit.c::merge_bases()

    for each bottom commit B {
	L = empty list
	B.flags |= PARENT2
	L.append(B)
	for each negative commit C in "list from limit_list()"
            C.flags |= PARENT1
            L.append(C)
	while (L) {
	    C = shift L;
	    flag = C.flags & (PARENT1|PARENT2);
            if (flag ==  (PARENT1|PARENT2))
 		continue; /* common */
	    for each parent P of commit C:
		pflag = P.flags & (PARENT1|PARENT2);
		if (pflag == flag)
                    continue;
		P.flags |= flags;
                L.append(P)
	}
        if (B.flags & PARENT1)
            we still need to traverse -- everybody_uninteresting()
	    in limit_list() main loop was not enough!
    }

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