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

From: Tian Yuchen <[email-masked]>
Date: Fri, 20 Mar 2026 08:24:09 +0800

On 3/20/26 02:07, Junio C Hamano wrote:
> The verb "check" does not imply side-effect-free.  By checking, each
> of these functions tries to achieve something, and the way the
> result of their work is conveyed back to the caller may not
> necessarily be only by their return values.
> 
> The adverb "gently" in this codebase typically means "the variant
> without gently signals problems by dying.  Instead of dying, return
> to the caller with error code, so that the caller can decide to
> die".

Ah, I see. I guess I took it too literally. Thank you for clarification!

Setting the semantics aside, the problem remains: I still think the 
setup method here isn't quite right. It creates a bottleneck for 
eventually handling multiple repositories in the same process without 
data races.

Do you think this is worth a patch?

Thanks,

Yuchen