Re: [PATCH v2 20/21] environment: stop storing "core.warnAmbiguousRefs" globally

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri Aug 30, 2024 at 7:09 PM AEST, Patrick Steinhardt wrote:
> Same as the preceding commits, storing the "core.warnAmbiguousRefs"
> value globally is misdesigned as this setting may be set per repository.
>
> Move the logic into the repo-settings subsystem. The usual pattern here
> is that users are expected to call `prepare_repo_settings()` before they
> access the settings themselves. This seems somewhat fragile though, as
> it is easy to miss and leads to somewhat ugly code patterns at the call
> sites.
>
> Instead, introduce a new function that encapsulates this logic for us.
> This also allows us to change how exactly the lazy initialization works
> in the future, e.g. by only partially initializing values as requested
> by the caller.

Cool! `prepare_repo_settings()` is safe (and seems also reasonably cheap)
to execute multiple times.






[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux