Re: [RFC GSoC PATCH v3 0/2] Make read_attr() repository-aware by introducing a lazy bare state
- From
- Phillip Wood <phillip.wood123@gmail.com>
- Date
- Feb 19, 2026, 10:42 UTC
- Message-ID
- <0d6c5b14-1c53-4372-8395-7c7cba9fbf0b@gmail.com>
- In-Reply-To
- <20260208062949.596-1-kumarayushjha123@gmail.com>
Hi Ayush
On 08/02/2026 06:29, Ayush Jha wrote:
Show 8 quoted lines
> This patch series is v3 of an earlier RFC that aimed to remove the > dependency on the global `the_repository` from read_attr(). > > Based on feedback from Lucas Seiki Oshiro and Junio C Hamano, this > iteration introduces a repository-scoped, lazily initialized "bare" > state in struct repo_settings, exposed via repo_settings_get_is_bare(). > The read_attr() function is then updated to use this helper instead of > is_bare_repository().
Doesn't the lazy initialization here suffer from the same problems that Junio explained in https://lore.kernel.org/xmqqpl63b2tm.fsf@gitster.g ? Changing config settings that are currently parsed eagerly to being parsed lazily opens up a whole can of worms and is best avoided. As Junio said Bello Olamide is exploring a different approach that avoids the lazy parsing.
Thanks
Phillip
Show 15 quoted lines
> The series is split as follows: > 1/2 repo-settings: add repo_settings_get_is_bare > 2/2 attr: use local repository state in read_attr > > Comments and suggestions are welcome. > > Ayush Jha (2): > repo-settings: add repo_settings_get_is_bare > attr: use local repository state in read_attr > > attr.c | 3 ++- > repo-settings.c | 12 ++++++++++++ > repo-settings.h | 5 +++++ > 3 files changed, 19 insertions(+), 1 deletion(-) >