Re: [PATCH v2 3/7] commit-graph: simplify reading a single commit graph
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Dec 3, 2026, 13:19 UTC
- Message-ID
- <axFsSLb5MBzrt7EQ@pks.im>
- In-Reply-To
- <b2fbb878-0bd9-4bfe-b337-8fb9bc4edb0d@gmail.com>
On Thu, Dec 03, 2026 at 04:07:22PM +0530, Kaartic Sivaraam wrote:
Show 19 quoted lines
> On 11/20/26 17:52, Patrick Steinhardt wrote:
> > diff --git a/builtin/commit-graph.c b/builtin/commit-graph.c
> > index 8194a528406..2a5a75dc22f 100644
> > --- a/builtin/commit-graph.c
> > +++ b/builtin/commit-graph.c
> > diff --git a/commit-graph.h b/commit-graph.h
> > index f0e7cc93461..8660c7fe698 100644
> > --- a/commit-graph.h
> > +++ b/commit-graph.h
> > @@ -117,14 +117,12 @@ struct commit_graph {
> > };
> > /*
> > - * Load commit graphs from the given object directory `dir`. The directory may
> > - * be given as a relative path; it is canonicalized internally so that graphs
> > - * loaded from the same directory compare equal regardless of how the caller
> > - * spelled the path.
>
> Do we need to capture the canonicalization note somewhere else now so that
> we don't lose it?I wouldn't really know where to put it, and the way that the directory is derived will also become an implementation detail of the backend. So I wouldn't want to document semantics in the commit-graph layer yet.
Show 6 quoted lines
> > + * Read a single commit graph layer from the given file descriptor. The file > > + * descriptor will be closed regardless of whether loading succeeds. Returns > > + * NULL on error. > > */ > > Also, is it worth mentioning that this would leave dir and filename unset?
Same here. And also, it's kind of obvious that it doesn't because the function only accepts a file descriptor. So I'm inclined to leave this as-is.
Patrick