Git development
 help / color / mirror / Atom feed
* [PATCH v4 0/1] environment: move protect_hfs and protect_ntfs into repo_config_values
@ 2026-06-19 16:38 Tian Yuchen
  2026-06-19 16:38 ` [PATCH v4 1/1] environment: move 'protect_hfs' and 'protect_ntfs' into 'repo_config_values' Tian Yuchen
  2026-06-19 17:14 ` [PATCH v4 0/1] environment: move protect_hfs and protect_ntfs into repo_config_values Junio C Hamano
  0 siblings, 2 replies; 7+ messages in thread
From: Tian Yuchen @ 2026-06-19 16:38 UTC (permalink / raw)
  To: git; +Cc: Tian Yuchen, Christian Couder, Ayush Chandekar,
	Olamide Caleb Bello

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-06-20 15:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-19 16:38 [PATCH v4 0/1] environment: move protect_hfs and protect_ntfs into repo_config_values Tian Yuchen
2026-06-19 16:38 ` [PATCH v4 1/1] environment: move 'protect_hfs' and 'protect_ntfs' into 'repo_config_values' Tian Yuchen
2026-06-19 17:14 ` [PATCH v4 0/1] environment: move protect_hfs and protect_ntfs into repo_config_values Junio C Hamano
2026-06-19 17:25   ` Junio C Hamano
2026-06-20 13:38     ` Tian Yuchen
2026-06-20 14:09   ` [PATCH] environment: use 'repo->initialized' for repo_protect_hfs() and repo_protect_ntfs() Tian Yuchen
2026-06-20 15:18     ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox