From: Derrick Stolee Date: Wed, 25 Apr 2018 14:11:41 GMT Subject: Re: [PATCH v3 5/9] ref-filter: use generation number for --contains Message-ID: <1c63c945-aea0-4d15-9d0c-35092a00c30d@gmail.com> In-Reply-To: <868t9cfn6f.fsf@gmail.com> On 4/24/2018 2:56 PM, Jakub Narebski wrote: > Derrick Stolee writes: >> One way to fix this is to call 'prepare_commit_graph()' directly and >> then test that 'commit_graph' is non-null before performing any >> parses. I'm not thrilled with how that couples the commit-graph >> implementation to this feature, but that may be necessary to avoid >> regressions in the non-commit-graph case. > Another possible solution (not sure if better or worse) would be to > change the signature of contains_tag_algo() function to take parameter > or flag that would decide whether to parse "wants". If I reorder commits so "commit-graph:always load commit-graph information" is before this one, then we can call load_commit_graph_info() which just fills the generation and graph_pos information. This will keep the coupling very light, instead of needing to call prepare_commit_graph() or checking the config setting. Thanks, -Stolee