git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/2] environment: move ignore_case into repo_config_values

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 17, 2026, 17:16 UTC
Message-ID
<xmqqh5n1w0i7.fsf@gitster.g>
In-Reply-To
<20260617154929.564498-2-cat@malon.dev>
Tian Yuchen <cat@malon.dev> writes:
Show 5 quoted lines
> 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.
Previous: Tian YuchenNext: Tian Yuchen
Message 3 of 18 in “environment: move ignore_case into repo_config_values”
  1. 0/2 environment: move ignore_case into repo_config_valuesTian Yuchen, Jun 17, 2026
  2. 1/2 environment: move ignore_case into repo_config_valuesTian Yuchen, Jun 17, 2026
  3. Junio C HamanoJun 17, 2026
  4. Tian YuchenJun 18, 2026
  5. 2/2 config: use repo_get_ignore_case() to access core.ignorecaseTian Yuchen, Jun 17, 2026
  6. 0/2 environment: move ignore_case into repo_config_valuesTian Yuchen, Jun 18, 2026
  7. 1/2 environment: move ignore_case into repo_config_valuesTian Yuchen, Jun 18, 2026
  8. 2/2 config: use repo_ignore_case() to access core.ignorecaseTian Yuchen, Jun 18, 2026
  9. Junio C HamanoJun 18, 2026
  10. Tian YuchenJun 19, 2026
  11. 0/2 environment: move ignore_case into repo_config_valuesTian Yuchen, Jun 19, 2026
  12. 1/2 environment: move ignore_case into repo_config_valuesTian Yuchen, Jun 19, 2026
  13. 2/2 config: use repo_ignore_case() to access core.ignorecaseTian Yuchen, Jun 19, 2026
  14. Junio C HamanoJun 21, 2026
  15. Tian YuchenJun 22, 2026
  16. Junio C HamanoJun 22, 2026
  17. Johannes SchindelinJul 10, 2026
  18. Junio C HamanoJul 10, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.