From: Patrick Steinhardt <ps@pks.im>
To: Joy via GitGitGadget <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org,
"Usman Akinyemi>" <usmanakinyemi202@gmail.com>,
"Christian Couder@imap.fastmail.com>"
<christian.couder@gmail.com>, Joy <soniqjjj@gmail.com>
Subject: Re: [PATCH] config: move pack size limit into repo config
Date: Wed, 21 Oct 2026 10:09:13 +0200 [thread overview]
Message-ID: <athzKcUyQjqUTKzZ@pks.im> (raw)
In-Reply-To: <pull.2271.git.1792522587065.gitgitgadget@gmail.com>
On Tue, Oct 20, 2026 at 06:56:27PM +0000, Joy via GitGitGadget wrote:
> From: Joy Gundu <soniqjjj@gmail.com>
>
> Store the pack.packsizelimit value in repository configuration
> rather than keeping it in a standalone global variable for the repository.
>
> Update the configuration parser and pack-writing code to read
> the value from repo_config_values rather than a global variable.
>
> This change removes one piece of global configuration state from Git
> and helps make Git code easier to reuse as a library component.
The commit message typically starts with an observation, followed by an
explanation what's bad about the observed status quo and then finally
explains how that state is improved. The order you have here does not
match that typical flow.
> diff --git a/environment.c b/environment.c
> index c83cf44839..e350d6949e 100644
> --- a/environment.c
> +++ b/environment.c
> @@ -728,7 +727,7 @@ int git_default_config(const char *var, const char *value,
> }
>
> if (!strcmp(var, "pack.packsizelimit")) {
> - pack_size_limit_cfg = git_config_ulong(var, value, ctx->kvi);
> + cfg->pack_size_limit = git_config_ulong(var, value, ctx->kvi);
> return 0;
> }
>
> @@ -768,6 +767,7 @@ void repo_config_values_init(struct repo_config_values *cfg)
> cfg->check_stat = 1;
> cfg->zlib_compression_level = Z_BEST_SPEED;
> cfg->pack_compression_level = Z_DEFAULT_COMPRESSION;
> + cfg->pack_size_limit = 0;
> cfg->precomposed_unicode = -1; /* see probe_utf8_pathname_composition() */
> cfg->core_sparse_checkout_cone = 0;
> cfg->warn_on_object_refname_ambiguity = 1;
Hmm, quite annoying that we need to explicitly zero out all these
fields. Maybe we should adapt `repo_config_values_init()` to first
`memset(cfg, 0, sizeof(*cfg))`? That would allow us to remove a lot of
assignments. If you want to do that, it would be great to do it as a
preparatory patch in the same series.
Other than that the diff looks exactly the same as a local patch I had
already written myself, so thanks for allowing me to worry about one
less thing :)
Patrick
next prev parent reply other threads:[~2026-10-21 8:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-20 18:56 [PATCH] config: move pack size limit into repo config Joy via GitGitGadget
2026-10-20 19:02 ` Kristoffer Haugsbakk
2026-10-21 8:09 ` Patrick Steinhardt [this message]
2026-10-21 12:23 ` Joie Joie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=athzKcUyQjqUTKzZ@pks.im \
--to=ps@pks.im \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=soniqjjj@gmail.com \
--cc=usmanakinyemi202@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox