Git development
 help / color / mirror / Atom feed
From: "Mark C. Chu-Carroll" <markchucarroll@fastmail.com>
To: "Christian Couder" <christian.couder@gmail.com>,
	"Mark C. Chu-Carroll" <markchucarroll@fastmail.com>
Cc: <git@vger.kernel.org>
Subject: Re: [PATCH v5 2/2] repo: make concern thresholds configurable
Date: Mon, 30 Nov 2026 13:48:47 -0500	[thread overview]
Message-ID: <DN8RQL4KLDF2.DMJ9DQS9Y13Q@fastmail.com> (raw)
In-Reply-To: <CAP8UFD39_1Km5JL9tZu1L+JDYxG5fyfAoLT1X55km85P=-o+BQ@mail.gmail.com>

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
> <markchucarroll@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: mcarroll@gitlab.com / markchucarroll@fastmail.com
*** Personal Blog: http://goodmath.org/blog / Personal email: markcc@gmail.com


      reply	other threads:[~2026-11-30 18:48 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-21 13:55 [PATCH 0/3] repo: add degree-of-concern reporting to structure Mark C. Chu-Carroll
2026-10-21 13:55 ` [PATCH 1/3] repo: add level of concern reporting Mark C. Chu-Carroll
2026-10-21 13:55 ` [PATCH 2/3] repo: make concern thresholds configurable Mark C. Chu-Carroll
2026-10-21 13:55 ` [PATCH 3/3] repo: add documentation for level-of-concern Mark C. Chu-Carroll
2026-10-26 17:43 ` [PATCH v2 0/3] repo: add degree-of-concern reporting to structure Mark C. Chu-Carroll
2026-10-26 17:43   ` [PATCH v2 1/3] repo: add level of concern reporting Mark C. Chu-Carroll
2026-10-27 14:55     ` Patrick Steinhardt
2026-10-26 17:43   ` [PATCH v2 2/3] repo: make concern thresholds configurable Mark C. Chu-Carroll
2026-10-27 14:55     ` Patrick Steinhardt
2026-10-26 17:43   ` [PATCH v2 3/3] repo: add documentation for level-of-concern Mark C. Chu-Carroll
2026-10-27 14:55     ` Patrick Steinhardt
2026-10-28 13:23       ` Mark C. Chu-Carroll
2026-10-27 15:39 ` [PATCH v3 0/2] repo: add degree-of-concern reporting to structure Mark C. Chu-Carroll
2026-10-27 15:39   ` [PATCH v3 1/2] repo: add level of concern reporting Mark C. Chu-Carroll
2026-10-27 15:39   ` [PATCH v3 2/2] repo: make concern thresholds configurable Mark C. Chu-Carroll
2026-10-29 17:52 ` [PATCH v4 0/2] repo: add degree-of-concern reporting to structure Mark C. Chu-Carroll
2026-10-29 17:52   ` [PATCH v4 1/2] repo: add level of concern reporting Mark C. Chu-Carroll
2026-10-29 19:53     ` Junio C Hamano
2026-10-29 20:20       ` Mark C. Chu-Carroll
2026-10-29 17:52   ` [PATCH v4 2/2] repo: make concern thresholds configurable Mark C. Chu-Carroll
2026-11-02 16:32 ` [PATCH v5 0/2] repo: add degree-of-concern reporting to structure Mark C. Chu-Carroll
2026-11-02 16:32   ` [PATCH v5 1/2] repo: add level of concern reporting Mark C. Chu-Carroll
2026-11-18 17:34     ` Christian Couder
2026-11-30 15:44       ` Mark C. Chu-Carroll
2026-11-19 19:44     ` Junio C Hamano
2026-11-30 18:51       ` Mark C. Chu-Carroll
2026-11-02 16:32   ` [PATCH v5 2/2] repo: make concern thresholds configurable Mark C. Chu-Carroll
2026-11-18 17:36     ` Christian Couder
2026-11-30 18:48       ` Mark C. Chu-Carroll [this message]

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=DN8RQL4KLDF2.DMJ9DQS9Y13Q@fastmail.com \
    --to=markchucarroll@fastmail.com \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    /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