Re: [PATCH v2 1/8] environment: move "trust_ctime" into `struct repo_config_values`
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Apr 15, 2026, 11:16 UTC
- Message-ID
- <CAOLa=ZT8H3xLXjact9it9jveviztL4Q72KNMk5nxW_ouq0T0=A@mail.gmail.com>
- In-Reply-To
- <53f43b85-b274-4352-938b-d40f942bfb2d@gmail.com>
Phillip Wood <phillip.wood123@gmail.com> writes:
Show 25 quoted lines
> On 14/04/2026 09:52, Karthik Nayak wrote: >> Olamide Caleb Bello <belkid98@gmail.com> writes: >> >>> The `core.trustctime` configuration is currently stored in the global >>> variable `trust_ctime`, which makes it shared across repository >>> instances in a single process. >>> >>> Store it instead in `repo_config_values`, so the value is tied to the >>> repository from which it was read. This preserves existing behavior >>> while avoiding cross-repository state leakage and continues the effort >>> to reduce reliance on global configuration state. >>> >>> Update all references to use repo_config_values(). >>> >> >> Nit: I was hoping you'd also shed light on why this can go into >> `repo_config_values()`. Does it need to be eagerly parsed? If so, why? > > If trust_ctime was lazily parsed where it is used we'd end up dying in > match_stat_data() which would be quite unexpected, make it very hard to > reason about the code, and hamper the libification efforts. I'd much > rather we put the onus on patch authors to justify any conversion from > eager parsing to lazy parsing rather than forcing them to justify > continuing to parse settings eagerly. >
Agreed. A note in the commit message that this belongs in `repo_config_values()` because it's eagerly parsed would be enough.
> Thanks > > Phillip >
[snip]