Re: [PATCH v3 9/9] odb/transaction: add transaction interface to write packfiles
Patrick Steinhardt <[email protected]>
| Newsgroups | org.kernel.vger.git |
|---|---|
| Message-ID | <[email protected]> |
On Fri, Aug 14, 2026 at 08:40:32AM -0500, Justin Tobler wrote:
> On 26/08/14 10:51AM, Patrick Steinhardt wrote:
> > On Tue, Aug 11, 2026 at 12:54:15PM -0500, Justin Tobler wrote:
> > > +static unsigned int get_unpack_limit(struct repository *repo)
> > > +{
> > > + unsigned int limit = 100;
> > > +
> > > + repo_config_get_uint(repo, "transfer.unpacklimit", &limit);
> > > + repo_config_get_uint(repo, "receive.unpacklimit", &limit);
> > > +
> > > + return limit;
> > > +}
> >
> > One thing I noticed just now: as the intention is that `write_pack()`
> > will be called for more use cases than only git-receive-pack(1) we'll
> > have to add a way to tell the callback what scenario they are running
> > in. I still think moving the unpack limit into the backend is sensible,
> > but now we're not givint it enough information.
>
> So we already have transaction flags like ODB_TRANSACTION_RECEIVE that
> can be used to differentiate certain callers that may require slightly
> different behavior in the backend.
>
> In a followup series where I expand usage of odb_transaction_write_pack
> to git-fetch-pack(1), I was originally planning on using this flag and
> also adding ODB_TRANSACTION_FETCH accordingly. It's probably a good idea
> to go ahead though and start using the transaction flags here in this
> series too. Will update in the next version.
Ah, that makes sense then. And I agree, introducing that flag now
already makes it a bit more obvious for how future series will look
like. Thanks!
Patrick