Re: [PATCH v3 9/9] odb/transaction: add transaction interface to write packfiles

Justin Tobler <[email protected]>
Newsgroups org.kernel.vger.git
Message-ID <an8YSE8iIDXPSkH8@denethor>
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.

-Justin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.