Re: [PATCH 1/3] commit-reach: implement get_reachable_subset

2018-11-01 Thread Junio C Hamano
Derrick Stolee writes: > We could do this, but it does come with a performance hit when the following > are all true: > > 1. 'to' is not reachable from any 'from' commits. > > 2. The 'to' and 'from' commits are close in commit-date. > > 3. Generation numbers are not available, or the topology is

Re: [PATCH 1/3] commit-reach: implement get_reachable_subset

2018-10-31 Thread Derrick Stolee
On 10/30/2018 11:35 PM, Junio C Hamano wrote: "Derrick Stolee via GitGitGadget" writes: +struct commit_list *get_reachable_subset(struct commit **from, int nr_from, +struct commit **to, int nr_to, +int

Re: [PATCH 1/3] commit-reach: implement get_reachable_subset

2018-10-31 Thread Derrick Stolee
On 10/31/2018 2:07 AM, Elijah Newren wrote: On Tue, Oct 30, 2018 at 7:16 AM Derrick Stolee via GitGitGadget wrote: --- a/commit-reach.c +++ b/commit-reach.c @@ -688,3 +688,73 @@ int can_all_from_reach(struct commit_list *from, struct commit_list *to, object_array_clear(_objs);

Re: [PATCH 1/3] commit-reach: implement get_reachable_subset

2018-10-31 Thread Elijah Newren
On Tue, Oct 30, 2018 at 7:16 AM Derrick Stolee via GitGitGadget wrote: > --- a/commit-reach.c > +++ b/commit-reach.c > @@ -688,3 +688,73 @@ int can_all_from_reach(struct commit_list *from, struct > commit_list *to, > object_array_clear(_objs); > return result; > } > + > +struct

Re: [PATCH 1/3] commit-reach: implement get_reachable_subset

2018-10-30 Thread Junio C Hamano
"Derrick Stolee via GitGitGadget" writes: > +struct commit_list *get_reachable_subset(struct commit **from, int nr_from, > + struct commit **to, int nr_to, > + int reachable_flag) This is OR'ed into object.flags, and I

[PATCH 1/3] commit-reach: implement get_reachable_subset

2018-10-30 Thread Derrick Stolee via GitGitGadget
From: Derrick Stolee The existing reachability algorithms in commit-reach.c focus on finding merge-bases or determining if all commits in a set X can reach at least one commit in a set Y. However, for two commits sets X and Y, we may also care about which commits in Y are reachable from at least