From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh-b6-smtp.messagingengine.com (fhigh-b6-smtp.messagingengine.com [202.12.124.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2FC41330B22 for ; Wed, 17 Jun 2026 17:16:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.157 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781716598; cv=none; b=PtwAOj/xJJSJN/k9KjSnKai1SU5IRYXHwvu0MaluTIkU58rY7Dw3wgerH2K0jhrjlI5p7CSNnVlR0/EN1KB/V+NTxhaBW/RAkUk/UNDwxA+tM1M4ovNuBoxMbkQN6lgagrGr+/ry8gDwljB37SvGZFoRkk+Z/OQ/7Gr2M7qse6A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781716598; c=relaxed/simple; bh=hGa6FYdtFYsD9Qj/TvT0QegPtQEUIkTAGtxtob7aEbg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=JiVhYxrECd4OzmTB9ZjeJLAfvZP2TvJ4YMVrHtAH7gcZdFbxZ/I//pnkIwMEsG1AzXw7RIM7NX8pJ6SNy0qykqX4vXfWWm4fSeN2YZBSOogEauEzhLXeHN1kOBEZreK1SSb7YdLR4LFXY31CrwYGvOZpSJY/RCRvhWxQQcpFELI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com; spf=pass smtp.mailfrom=pobox.com; dkim=pass (2048-bit key) header.d=pobox.com header.i=@pobox.com header.b=jO5pJ/Lv; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Ysh3C3ZJ; arc=none smtp.client-ip=202.12.124.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pobox.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pobox.com header.i=@pobox.com header.b="jO5pJ/Lv"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Ysh3C3ZJ" Received: from phl-compute-09.internal (phl-compute-09.internal [10.202.2.49]) by mailfhigh.stl.internal (Postfix) with ESMTP id D554C7A0150; Wed, 17 Jun 2026 13:16:33 -0400 (EDT) Received: from phl-frontend-01 ([10.202.2.160]) by phl-compute-09.internal (MEProxy); Wed, 17 Jun 2026 13:16:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pobox.com; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1781716593; x=1781802993; bh=b3oRKkXBa3 gtmNvpLc7MxaJIbmEWVm+WUre78/ZnONE=; b=jO5pJ/Lv5iMHSvoVz7F2qFG4aT GgrRBlzLrBmKzpTpWd82aMUxNMC6REbpe7FAUXNK3yiyi6zphzceyYr72vPjtD35 JzNEOwC6txVsk0kP3tQaUvEFBrZwTLlT2bIaGbWro312jbBg7454k70RYXYWiHWu 6zEbZqcpQusJJFShacTkuaj3gBYbbbh1iTk+p2/dFzNfjrRGDtqaOyflWzYsOT0s M1/gIAG8Q+S7AA8ojjCsvMVCOYz+GR951Y6GwMmjc20SYraDjghFFGEMIm/sIXDp vOoagUDT4jq1zwCTpM38/+sysuCkcbM5pdLIlkMDxKmAe7fVKkQbJbJ5AKtg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1781716593; x=1781802993; b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kwn1PgCIsb1c HZfOnNELnCaNfagr5XRYKcGqMACyghd4qx0Nn71qlRruWr1tPiH4+Cr3i0Vw X-ME-Proxy: Feedback-ID: if26b431b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 17 Jun 2026 13:16:32 -0400 (EDT) From: Junio C Hamano To: Tian Yuchen Cc: git@vger.kernel.org, ps@pks.im, phillip.wood123@gmail.com, johannes.schindelin@gmx.de, stolee@gmail.com, Christian Couder , Ayush Chandekar , Olamide Caleb Bello Subject: Re: [PATCH 1/2] environment: move ignore_case into repo_config_values In-Reply-To: <20260617154929.564498-2-cat@malon.dev> (Tian Yuchen's message of "Wed, 17 Jun 2026 23:49:28 +0800") References: <20260617154929.564498-1-cat@malon.dev> <20260617154929.564498-2-cat@malon.dev> Date: Wed, 17 Jun 2026 10:16:32 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Tian Yuchen writes: > Note that the newly introduced getter, 'repo_get_ignore_case()', > intentionally avoids checking 'repo->gitdir'. This could safely > accommodates early dynamic probing of the filesystem during > 'git init' or clone operations, where the 'gitdir' might not be fully > initialized but the filesystem capability must be recorded. Why "could"? It either "safely accommodates" or it doesn't. I do not quite understand the logic behind this part. Why is it OK to punt until .gitdir is ready for trust-executable-bit, like it is done in f951ed98 (environment: move trust_executable_bit into repo_config_values, 2026-06-13) diff --git a/environment.c b/environment.c index fc3ed8bb1c..75069a884d 100644 --- a/environment.c +++ b/environment.c @@ -142,6 +141,13 @@ int is_bare_repository(void) return is_bare_repository_cfg && !repo_get_work_tree(the_repository); } +int repo_trust_executable_bit(struct repository *repo) +{ + return repo->gitdir? + repo_config_values(repo)->trust_executable_bit : + 1; +} + or hfs/ntfs in 71386c21 (environment: move 'protect_hfs' and 'protect_ntfs' into 'repo_config_values', 2026-06-10) diff --git a/environment.c b/environment.c index fc3ed8bb1c..683fe1b4d3 100644 --- a/environment.c +++ b/environment.c @@ -142,6 +140,20 @@ int is_bare_repository(void) return is_bare_repository_cfg && !repo_get_work_tree(the_repository); } +int repo_protect_ntfs(struct repository *repo) +{ + return repo->gitdir ? + repo_config_values(repo)->protect_ntfs : + PROTECT_NTFS_DEFAULT; +} + +int repo_protect_hfs(struct repository *repo) +{ + return repo->gitdir ? + repo_config_values(repo)->protect_hfs : + PROTECT_HFS_DEFAULT; +} + int have_git_dir(void) { return startup_info->have_repository but not for this bit? > +int repo_get_ignore_case(struct repository *repo) > +{ > + if (repo) > + return repo_config_values(repo)->ignore_case; > + return 0; > +} What makes ignore-case so special? Doesn't the same logic apply to the other three bits? Or use a more direct if (repo && repo->initialized) ...; for all three, as repo_config_values(repo) barfs when repo is not initialized? I dunno.