Subject: Re: [Question] check_repository_format_gently() is not side-effect-free

From: Tian Yuchen <[email-masked]>
Date: Sat, 21 Mar 2026 00:26:21 +0800

Hi Patrick,

On 3/20/26 14:07, Patrick Steinhardt wrote:

> Yes, I think that the whole of "setup.c" is something we will want to
> refactor eventually so that it does not modify global state anymore. So
> it's not only `check_repository_format_gently()`, but also lots of other
> functionality in that file. The motivation is not only being able to set
> up multiple repositories, but also making the code overall easier to
> understand.
> 
> That being said, I'll give a small warning that it's probably
> non-trivial to refactor this subystem 🙂

Thanks for the reply!

It’s true — setup.c seems utterly baffling to me. I thought I understood 
it before, but the more closely I look at it, the more I realize there 
are details everywhere that require careful attention.

I won't drop a break-the-world patch out of nowhere. I'll keep learning 
until I'm able to do so ;)

Thanks,

Yuchen