On Wed Nov 18, 2026 at 12:36 PM EST, Christian Couder wrote:
> On Mon, Nov 2, 2026 at 7:39 PM Mark C. Chu-Carroll
> <mark…@fastmail.com> wrote:
>
>> +static int config_concern_thresholds(const char *config_val_name,
>> + const char *str_val,
>> + const struct config_context *ctx,
>> + void *cb)
>> +{
>> + struct concern_stat_threshold *thresholds = cb;
>> + const char *concern_name;
>> + if (skip_prefix(config_val_name, REPO_STRUCTURE_CONFIG_PREFIX, &concern_name)) {
>> + for (int i = 0; thresholds[i].name; i++) {
>
> In the previous patch `size_t i = 0` is used in the `for (...)`, so I
> think the same should be used here.
Absolutely.
>> + if (!strcmp(thresholds[i].name, concern_name)) {
>> + int threshold = git_config_int(concern_name, str_val, ctx->kvi);
>
> The `threshold` member in `struct concern_stat_threshold` is a
> `size_t` and that's where we are going to store the value from
> nearest_log2_value() below. So it seems strange that we read only an
> `int` from the config. I think this should use git_config_size_t() to
> read a `size_t` instead.
>
> Not sure also if the whole feature is supposed to work on 32 bit
> systems. But maybe Git on a 32 bit system just cannot reach concerning
> levels of anything.
I agree about the size_t. I'm not sure what do do about the latter
part; I think size_t is semantically the right type for these values,
but it's true that on a 32 bit system, size_t is probably going to be
a 32 bit value, which will make this go awry. But I don't know of
a good solution for that. I mean, I suppose we could use something like
`unsigned long long`, but that feels really ugly.
Thanks for the review!
-Mark
--
Mark Craig Chu-Carroll (@MarkChuCarroll at gitlab)
*** Software Tools/Math Geek - Software Engineer at Gitlab
*** Work Email: mcar…@gitlab.com / mark…@fastmail.com
*** Personal Blog: http://goodmath.org/blog / Personal email: mark…@gmail.com