Re: [PATCH v3 6/9] commit: use generation numbers for in_merge_bases()
- From
Derrick Stolee <stolee@gmail.com>
- Date
- Apr 23, 2018, 14:31 UTC
- Message-ID
- <258ad61b-c262-5144-12e7-5068851e34d4@gmail.com>
- In-Reply-To
- <86k1t4go0l.fsf@gmail.com>
On 4/18/2018 6:15 PM, Jakub Narebski wrote:
Show 12 quoted lines
> Derrick Stolee <dstolee@microsoft.com> writes: > >> The containment algorithm for 'git branch --contains' is different >> from that for 'git tag --contains' in that it uses is_descendant_of() >> instead of contains_tag_algo(). The expensive portion of the branch >> algorithm is computing merge bases. >> >> When a commit-graph file exists with generation numbers computed, >> we can avoid this merge-base calculation when the target commit has >> a larger generation number than the target commits. > You have "target" twice in above paragraph; one of those should probably > be something else.
Thanks. Second "target" should be "initial".
Show 9 quoted lines
> [...] >> + >> + if (commit->generation > min_generation) >> + return 0; > Why not use "return ret;" instead of "return 0;", like the rest of the > code [cryptically] does, that is: > > + if (commit->generation > min_generation) > + return ret;
Sure.
Thanks, -Stolee