Re: [Question] check_repository_format_gently() is not side-effect-free
- From
Tian Yuchen <cat@malon.dev>
- Date
- Mar 20, 2026, 00:24 UTC
- Message-ID
- <00d622d4-cfb8-41ff-b2df-5fb58a492a75@malon.dev>
- In-Reply-To
- <xmqqfr5vlmlu.fsf@gitster.g>
On 3/20/26 02:07, Junio C Hamano wrote:
Show 9 quoted lines
> 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