Git development
 help / color / mirror / Atom feed
* [PATCH v1 0/4] environment.c: migrate 'trust_executable_bit' into 'repo_config_values'
@ 2026-05-30 16:05 Tian Yuchen
  2026-05-30 16:05 ` [PATCH v1 1/4] read-cache: remove redundant extern declarations Tian Yuchen
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Tian Yuchen @ 2026-05-30 16:05 UTC (permalink / raw)
  To: git; +Cc: christian.couder, ps, Tian Yuchen, Ayush Chandekar,
	Olamide Caleb Bello

The 'core.filemode' configuration, which is stored as a global
variable 'trust_executable_bit', is a core filesystem capability flag.

Move it into 'repo_config_values' to tie it to the specific
repository instance it was read from. Eager parsing is maintained
because this flag is heavily consulted in hot paths.

To avoid falling back to 'the_repository', refactor the signatures
of helper functions:

 - ce_mode_from_stat()
 - st_mode_from_ce()
 - fake_lstat()
 - check_removed()

These functions now accept a 'struct index_state *istate', ensuring
the correct context is seamlessly passed down to the lowest levels.

Note: 'repo_config_values()' still does not support any 'struct
repository' other than 'the_repository'. In other words, this series
of patches is laying the groundwork for the eventual elimination of
'the_repository'.

Previous related work:

 - [PATCH 2/6] config: add trust_executable_bit to global config

 - [PATCH] Refactor 'trust_executable_bit' to repository-scoped setting 
 (This series of patches was unsuccessful because the target location selected
 was 'struct repo_settings', which our analysis indicated was not the
 optimal choice. For further details, please see: [1])

[1] https://lore.kernel.org/git/837b5360b40f992351f489a0ae05fedf49884c6e.1685716420.git.gitgitgadget@gmail.com/
[2] https://lore.kernel.org/git/20260301190017.53539-1-dronarajgyawali@gmail.com/
[3] https://lore.kernel.org/git/xmqq1pht6nyx.fsf@gitster.g/

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 (4):
  read-cache: remove redundant extern declarations
  read-cache: move 'ce_mode_from_stat()' to 'read-cache.c'
  environment: move 'trust_executable_bit' into repo_config_values
  read-cache: pass 'istate' to stat/mode helper functions

 apply.c                |  6 ++++--
 builtin/update-index.c |  2 +-
 diff-lib.c             | 20 +++++++++---------
 environment.c          |  4 ++--
 environment.h          |  2 +-
 read-cache-ll.h        |  2 +-
 read-cache.c           | 47 ++++++++++++++++++++++++++++++++----------
 read-cache.h           | 17 +++------------
 8 files changed, 58 insertions(+), 42 deletions(-)

-- 
2.43.0


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

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

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-30 16:05 [PATCH v1 0/4] environment.c: migrate 'trust_executable_bit' into 'repo_config_values' Tian Yuchen
2026-05-30 16:05 ` [PATCH v1 1/4] read-cache: remove redundant extern declarations Tian Yuchen
2026-05-30 16:05 ` [PATCH v1 2/4] read-cache: move 'ce_mode_from_stat()' to 'read-cache.c' Tian Yuchen
2026-05-30 16:05 ` [PATCH v1 3/4] environment: move 'trust_executable_bit' into repo_config_values Tian Yuchen
2026-05-30 18:02   ` Christian Couder
2026-05-30 23:17   ` Junio C Hamano
2026-06-01 10:10     ` Tian Yuchen
2026-06-01 18:03       ` Tian Yuchen
2026-05-30 16:05 ` [PATCH v1 4/4] read-cache: pass 'istate' to stat/mode helper functions Tian Yuchen
2026-05-30 18:14   ` Christian Couder

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