Re: [PATCH 0/6] odb: track commit graphs via object source
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 4, 2025, 23:27 UTC
- Message-ID
- <xmqq1pol7q8i.fsf@gitster.g>
- In-Reply-To
- <20250904-b4-pks-commit-graph-via-source-v1-0-d932c2481e1a@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 18 quoted lines
> There's a trivial conflict with tc/last-modified that can be solved like
> this:
>
> diff --cc commit-graph.c
> index 9929c1ed87,2f20f66cfd..0000000000
> --- a/commit-graph.c
> +++ b/commit-graph.c
> @@@ -823,7 -812,12 +823,11 @@@ int corrected_commit_dates_enabled(stru
>
> struct bloom_filter_settings *get_bloom_filter_settings(struct repository *r)
> {
> - struct commit_graph *g;
> + struct commit_graph *g = prepare_commit_graph(r);
> +
> - if (!prepare_commit_graph(r))
> ++ if (!g)
> + return NULL;
> + The while (g) loop will be entirely skipped when g==NULL, and then the function returns NULL after iterating the loop, so there is not much reason to have these three lines for early-return, no?
> - g = r->objects->commit_graph;
> while (g) {
> if (g->bloom_filter_settings)
> return g->bloom_filter_settings;Thanks.