Re: [PATCH v3 7/9] commit: add short-circuit to paint_down_to_common()

2018-04-24 Thread Derrick Stolee
On 4/23/2018 5:38 PM, Jakub Narebski wrote: Derrick Stolee writes: On 4/18/2018 7:19 PM, Jakub Narebski wrote: Derrick Stolee writes: [...] [...], and this saves time during 'git branch --contains' queries that would otherwise walk "around" the

Re: [PATCH v3 7/9] commit: add short-circuit to paint_down_to_common()

2018-04-23 Thread Jakub Narebski
Derrick Stolee writes: > On 4/18/2018 7:19 PM, Jakub Narebski wrote: >> Derrick Stolee writes: >> > [...] >>> [...], and this saves time during 'git branch --contains' queries >>> that would otherwise walk "around" the commit we are inspecting. >>> >> If

Re: [PATCH v3 7/9] commit: add short-circuit to paint_down_to_common()

2018-04-23 Thread Derrick Stolee
On 4/18/2018 7:19 PM, Jakub Narebski wrote: Derrick Stolee writes: [...] [...], and this saves time during 'git branch --contains' queries that would otherwise walk "around" the commit we are inspecting. If I understand the code properly, what happens is that we can

Re: [PATCH v3 7/9] commit: add short-circuit to paint_down_to_common()

2018-04-19 Thread Jakub Narebski
Derrick Stolee writes: > @@ -876,7 +886,7 @@ static struct commit_list *merge_bases_many(struct commit > *one, int n, struct co > return NULL; > } > > - list = paint_down_to_common(one, n, twos); > + list = paint_down_to_common(one,

Re: [PATCH v3 7/9] commit: add short-circuit to paint_down_to_common()

2018-04-18 Thread Jakub Narebski
Derrick Stolee writes: > When running 'git branch --contains', the in_merge_bases_many() > method calls paint_down_to_common() to discover if a specific > commit is reachable from a set of branches. Commits with lower > generation number are not needed to correctly answer

[PATCH v3 7/9] commit: add short-circuit to paint_down_to_common()

2018-04-17 Thread Derrick Stolee
When running 'git branch --contains', the in_merge_bases_many() method calls paint_down_to_common() to discover if a specific commit is reachable from a set of branches. Commits with lower generation number are not needed to correctly answer the containment query of in_merge_bases_many(). Add a