Re: git-rev-list: proper lazy reachability

From: Linus Torvalds <torvalds@osdl.org>
Date: 2005-06-05 01:42:46
On Sat, 4 Jun 2005, Junio C Hamano wrote:
>
> Linus, what do you think rev-list should do given HEADs from two
> forks, like this?
> 
>     JC          git-rev-list JC LT ????
>      |
>      |  LT
>      |   |
>       \ /
>        |
>        |
>        |

Ahh. Ok, I'll fix it. Indeed, I think it should give everything up to the 
merge base.

> Current "proper lazy reachability" version, btw, does something
> very unexpected for my use pattern.  If you have more than one
> commits between the fork point and LT HEAD in the above picture,
> everything from the beginning of time to JC is given, or
> something silly like that.

Yes. The whole thing is written to literally expect to see the "stop here" 
thing, and that's when it starts poisoning the well.

Does this fix it for you (untested, of course)?

		Linus
---
diff --git a/rev-list.c b/rev-list.c
--- a/rev-list.c
+++ b/rev-list.c
@@ -160,6 +160,8 @@ int main(int argc, char **argv)
 		end = lookup_commit_reference(sha1[1]);
 		if (!end || parse_commit(end) < 0)
 			die("bad ending commit object");
+		end->object.flags |= UNINTERESTING;
+		commit_list_insert(end, &list);
 	}
 
 	commit_list_insert(commit, &list);
-
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
Received on Sun Jun 05 01:41:07 2005

This archive was generated by hypermail 2.1.8 : 2005-06-05 01:41:09 EST