From: Derrick Stolee Date: Mon, 23 Apr 2018 14:31:19 GMT Subject: Re: [PATCH v3 6/9] commit: use generation numbers for in_merge_bases() 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: > Derrick Stolee 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". > [...] >> + >> + 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