Re: [PATCH v3 1/6] odb: introduce interface to generate packfiles
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Aug 20, 2026, 11:38 UTC
- Message-ID
- <aobnSsQVOCSoR4kE@pks.im>
- In-Reply-To
- <CAOLa=ZSYyfOCs8Dr0Xdhv-=Q=j0z7vtfYqopDb07XuAm2PU84g@mail.gmail.com>
On Thu, Aug 20, 2026 at 03:16:37AM -0700, Karthik Nayak wrote:
Show 31 quoted lines
> Patrick Steinhardt <ps@pks.im> writes:
> > diff --git a/odb/source.h b/odb/source.h
> > index d69f8e2d1c..e2129766fc 100644
> > --- a/odb/source.h
> > +++ b/odb/source.h
> > @@ -278,6 +278,23 @@ struct odb_source {
> > */
> > bool (*optimize_required)(struct odb_source *source,
> > const struct odb_optimize_options *opts);
> > +
> > + /*
> > + * This callback is expected to start generating a packfile with the
> > + * given options. The pack shall be generated asynchronously so that
> > + * the caller can consume the pack data and progress output while the
> > + * pack is being generated.
> > + *
> > + * This callback is optional. Sources that cannot generate packfiles
> > + * shall leave it unset.
> > + *
> > + * The callback is expected to return 0 on success and populate the
> > + * `out` pointer with the pack generator, a negative error code
> > + * otherwise.
> > + */
> > + int (*generate_pack)(struct odb_source *source,
> > + struct odb_pack_generator **out,
> > + const struct odb_generate_pack_options *opts);
> > };
> >
>
> Nit: I see that `source` is unused anyways, do we need to pass it in? Or
> is just for consistency?Our specific implementation does not use it, but others might want. So it's mostly for consistency to give the callback enough context.
Patrick