public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
From: Tian Yuchen <cat@malon.dev>
To: Junio C Hamano <gitster@pobox.com>
Cc: Git <git@vger.kernel.org>
Subject: Re: [Question] check_repository_format_gently() is not side-effect-free
Date: Fri, 20 Mar 2026 08:24:09 +0800	[thread overview]
Message-ID: <00d622d4-cfb8-41ff-b2df-5fb58a492a75@malon.dev> (raw)
In-Reply-To: <xmqqfr5vlmlu.fsf@gitster.g>

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

  reply	other threads:[~2026-03-20  0:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-19 17:45 [Question] check_repository_format_gently() is not side-effect-free Tian Yuchen
2026-03-19 18:07 ` Junio C Hamano
2026-03-20  0:24   ` Tian Yuchen [this message]
2026-03-20  6:07     ` Patrick Steinhardt
2026-03-20 15:56       ` Junio C Hamano
2026-03-20 16:26       ` Tian Yuchen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=00d622d4-cfb8-41ff-b2df-5fb58a492a75@malon.dev \
    --to=cat@malon.dev \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox