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

[PATCH v4 0/1] environment: move protect_hfs and protect_ntfs into repo_config_values

From
Tian Yuchen <cat@malon.dev>
Date
Jun 19, 2026, 16:38 UTC
Message-ID
<20260619163823.652091-1-cat@malon.dev>
Hi everyone,

This series continues the ongoing libification effort by moving the global filesystem variables, 'protect_hfs' and 'protect_ntfs', into 'struct repo_config_values'.

Place them within the per-repository configuration structure aligns with our goal of removing global states.

For reviewers familiar with previous libification efforts, Derrick Stolee attempted to wrap this kind of filesystem-level variable using a lazy-loaded global accessor get_int_config_global() [1].

However, as Glen Choo pointed out in his review of that series [2], it is strongly preferred to use plain fields in a repository-scoped struct over global lazy-loaders, provided those fields are properly initialized during the setup process.

By moving these variables into repo_config_values and parsing them eagerly, we successfully tie the filesystem security flags to the specific repository instance without altering the timing of configuration warnings or introducing new global states.

Thanks!
Change since V3:
 - In repo_protect_hfs() and repo_protect_ntfs(), change repo->gitdir to
 using (repo && repo->initialized).

[1] https://lore.kernel.org/git/a42dd9397d07b2dc4a0d7e75bfe1af2e46cad262.1685716420.git.gitgitgadget@gmail.com/ [2] https://lore.kernel.org/git/kl6lbkhpzujf.fsf@chooglen-macbookpro.roam.corp.google.com/ [3] https://lore.kernel.org/git/20260612160527.167203-1-cat@malon.dev/

Mentored-by: Christian Couder <christian.couder@gmail.com>
Mentored-by: Ayush Chandekar <ayu.chandekar@gmail.com>
Mentored-by: Olamide Caleb Bello <belkid98@gmail.com>
Signed-off-by: Tian Yuchen <cat@malon.dev>
Tian Yuchen (1):
  environment: move 'protect_hfs' and 'protect_ntfs' into
    'repo_config_values'
 compat/mingw.c             |  2 +-
 environment.c              | 22 ++++++++++++++++++----
 environment.h              | 12 ++++++++++--
 read-cache.c               |  7 ++++---
 t/helper/test-path-utils.c | 24 +++++++++++++++---------
 5 files changed, 48 insertions(+), 19 deletions(-)
-- 
2.43.0
Next: Tian Yuchen
Message 1 of 7 in “environment: move protect_hfs and protect_ntfs into repo_config_values”
  1. 0/1 environment: move protect_hfs and protect_ntfs into repo_config_valuesTian Yuchen, Jun 19, 2026
  2. 1/1 environment: move 'protect_hfs' and 'protect_ntfs' into 'repo_config_values'Tian Yuchen, Jun 19, 2026
  3. Junio C HamanoJun 19, 2026
  4. Junio C HamanoJun 19, 2026
  5. Tian YuchenJun 20, 2026
  6. environment: use 'repo->initialized' for repo_protect_hfs() and repo_protect_ntfs()Tian Yuchen, Jun 20, 2026
  7. Junio C HamanoJun 20, 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.