Re: [PATCH v2 4/7] commit-graph: expose function to validate a commit graph chain
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Dec 3, 2026, 13:19 UTC
- Message-ID
- <axFsU7ov4px3gmAq@pks.im>
- In-Reply-To
- <faa1ad05-b19f-4876-85a1-4060abbad13f@gmail.com>
On Thu, Dec 03, 2026 at 04:31:10PM +0530, Kaartic Sivaraam wrote:
Show 28 quoted lines
> On 11/20/26 17:52, Patrick Steinhardt wrote: > > diff --git a/commit-graph.h b/commit-graph.h > > index 8660c7fe698..dc4f6194c72 100644 > > --- a/commit-graph.h > > +++ b/commit-graph.h > > @@ -134,6 +134,13 @@ struct commit_graph *load_commit_graph_chain_fd_st(struct object_database *odb, > > */ > > int commit_graph_link_base(struct commit_graph *g, > > struct commit_graph *base); > > + > > +/* > > + * Validate the chain of commit graph layers to ensure that all layers are > > + * compatible with one another. This may disable generation data and Bloom > > + * filters in case they aren't. > > + */ > > I just wonder if we could make potentially rephrase this comment as follows > to make it more useful? > > /* > * Reconcile the settings of a linked commit-graph chain, where `g` is > * its tip layer. Must be called after all layers have been linked. > * > * If any layer lacks generation data, generation data is disabled for > * all layers. Bloom filters are compared against the settings of the > * top-most layer that has them; lower layers with incompatible > * settings have their filters dropped, with a warning. > */
I wouldn't go into the details as deep, as that feels bound to go stale very fast. How about this instead:
/* * Finalize a linked commit graph chain, where `g` is the tip of the chain. * Must be called after all layers have been linked. This checks whether all * layers of the chain are compatible with one another. If not, incompatible * features will be disabled. */
> > +void commit_graph_validate_chain(struct commit_graph *g); > > In the same spirit, I wonder if commit_graph_reconcile_chain might be a > better name for this one?
I'm not a huge fan of the term "reconcile", but I agree that "validate" is not great, either. I'll rename this to "finalize" instead.
Patrick