Skip to content

environment: move protect_hfs and protect_ntfs into repo_config_values

Tian Yuchen git 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest1 patch 3 repliesIn review
  2. v31 patch 0 repliesSuperseded
  3. v21 patch 3 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v11 patch2 repliesSuperseded

Changes in v4 from the cover letter

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1environment: move 'protect_hfs' and 'protect_ntfs' into 'repo_config_values'compat/mingw.c environment.c environment.h +2 more+48 -190 replies

Reviews trailers per patch

The patch has no Reviewed-by or Acked-by.

PatchChristian CouderAyush ChandekarOlamide Caleb Bello
SeriesMentored-by Mentored-by Mentored-by Mentored-by Mentored-by Mentored-by
1/1Mentored-by Mentored-by Mentored-by

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v4 thread

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

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/[email protected]/
[3] https://lore.kernel.org/git/[email protected]/

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(-)
Signature · 1 line
2.43.0