Re: [PATCH 6/8] commit: provide a fast multi-tip contains function

2014-07-01 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: If you are trying to do branch --with $commit, what you would want is not exactly paint-down-to-common(all branches, $commit), but something that paints down to $commit from all branches, with an optimization that cuts off the traversal at a commit

Re: [PATCH 6/8] commit: provide a fast multi-tip contains function

2014-07-01 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: I forgot about the other direction, i.e. branch --merged $commit. Since I do git branch --no-merged pu fairly often, I care about its performance ;-) We paint $commit as Left, and tips of all the branches as Right. We try to paint down from $commit

Re: [PATCH 6/8] commit: provide a fast multi-tip contains function

2014-06-26 Thread Junio C Hamano
Jeff King p...@peff.net writes: I haven't quite convinced myself that the stale logic in the middle is right. The origin paint_down function checks PARENT1 | PARENT2 to see if we found a merge base (even though PARENT2 may represent many tips). Here I check whether we have _any_ left parent

Re: [PATCH 6/8] commit: provide a fast multi-tip contains function

2014-06-26 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: The only time you can say Ah, we've seen this one and no need to dig further is when you are propagating a colour C and the parent in question is already painted in C (it is OK to be painted as reachable from more tips), I would think, so shouldn't the

Re: [PATCH 6/8] commit: provide a fast multi-tip contains function

2014-06-26 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: What does it mean to look for branch --with $commit1 $commit2 (i.e. more than one in the Left set)? If we are trying to see which branches reach _both_ of these commits, then replace the ablve with if a commit is already painted as reachable from both