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

Patrick Steinhardt <[email protected]>
Newsgroups org.kernel.vger.git
Message-ID <[email protected]>
On Wed, Aug 19, 2026 at 04:53:11PM -0500, Justin Tobler wrote:
> diff --git a/object-file.c b/object-file.c
> index db63587f6d..265c5f7a3c 100644
> --- a/object-file.c
> +++ b/object-file.c
[snip]
> +static unsigned int get_unpack_limit(struct repository *repo,
> +				     enum odb_transaction_flags flags)
> +{
> +	unsigned int limit = 0;
> +
> +	if (flags & ODB_TRANSACTION_RECEIVE) {
> +		limit = 100;
> +		repo_config_get_uint(repo, "transfer.unpacklimit", &limit);
> +		repo_config_get_uint(repo, "receive.unpacklimit", &limit);
> +	}
> +
> +	return limit;
> +}

Okay, instead of assuming that we're running in git-receive-pack(1) we
now pass this information along via the flags so that we can pick the
correct limit for the given operation. That's somewhat pointless right
now as no other operations use this infra yet, but the upside is that it
makes it obvious for how to extend the mechanism going forward.

Also, we no longer cache the value and the logic to derive it has become
a lot simpler. Good.

Patrick
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.