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

[PATCH v1 0/4] environment.c: migrate 'trust_executable_bit' into 'repo_config_values'

From
Tian Yuchen <cat@malon.dev>
Date
May 30, 2026, 16:05 UTC
Message-ID
<20260530160520.77859-1-cat@malon.dev>

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
Next: Tian Yuchen
Message 1 of 62 in “environment.c: migrate 'trust_executable_bit' into 'repo_config_values'”
  1. 0/4 environment.c: migrate 'trust_executable_bit' into 'repo_config_values'Tian Yuchen, May 30, 2026
  2. 2/4 read-cache: move 'ce_mode_from_stat()' to 'read-cache.c'Tian Yuchen, May 30, 2026
  3. Patrick SteinhardtJun 4, 2026
  4. Tian YuchenJun 10, 2026
  5. 3/4 environment: move 'trust_executable_bit' into repo_config_valuesTian Yuchen, May 30, 2026
  6. Christian CouderMay 30, 2026
  7. Junio C HamanoMay 30, 2026
  8. Tian YuchenJun 1, 2026
  9. Tian YuchenJun 1, 2026
  10. Junio C HamanoJun 9, 2026
  11. 4/4 read-cache: pass 'istate' to stat/mode helper functionsTian Yuchen, May 30, 2026
  12. Christian CouderMay 30, 2026
  13. 1/4 read-cache: remove redundant extern declarationsTian Yuchen, May 30, 2026
  14. 0/3 environment: migrate 'trust_executable_bit' into 'repo_config_values'Tian Yuchen, Jun 10, 2026
  15. 1/3 read-cache: remove redundant extern declarationsTian Yuchen, Jun 10, 2026
  16. 2/3 read-cache: move 'ce_mode_from_stat()' to 'read-cache.c'Tian Yuchen, Jun 10, 2026
  17. Christian CouderJun 12, 2026
  18. 3/3 environment: move trust_executable_bit into repo_config_valuesTian Yuchen, Jun 10, 2026
  19. Tian YuchenJun 11, 2026
  20. Christian CouderJun 12, 2026
  21. Junio C HamanoJun 12, 2026
  22. 0/3 environment: migrate 'trust_executable_bit' into 'repo_config_values'Tian Yuchen, Jun 12, 2026
  23. 2/3 read-cache: move 'ce_mode_from_stat()' to 'read-cache.c'Tian Yuchen, Jun 12, 2026
  24. 1/3 read-cache: remove redundant extern declarationsTian Yuchen, Jun 12, 2026
  25. 3/3 environment: move trust_executable_bit into repo_config_valuesTian Yuchen, Jun 12, 2026
  26. 0/3 environment: migrate 'trust_executable_bit' into 'repo_config_values'Tian Yuchen, Jun 19, 2026
  27. 1/3 read-cache: remove redundant extern declarationsTian Yuchen, Jun 19, 2026
  28. 2/3 read-cache: move 'ce_mode_from_stat()' to 'read-cache.c'Tian Yuchen, Jun 19, 2026
  29. 3/3 environment: move trust_executable_bit into repo_config_valuesTian Yuchen, Jun 19, 2026
  30. Junio C HamanoJun 29, 2026
  31. Tian YuchenJul 15, 2026
  32. 0/4 environment: migrate 'trust_executable_bit' and 'has_symlinks' into 'repo_config_values'Tian Yuchen, Jul 15, 2026
  33. 1/4 read-cache: remove redundant extern declarationsTian Yuchen, Jul 15, 2026
  34. 2/4 read-cache: move 'ce_mode_from_stat()' to 'read-cache.c'Tian Yuchen, Jul 15, 2026
  35. 3/4 environment: move trust_executable_bit into repo_config_valuesTian Yuchen, Jul 15, 2026
  36. 4/4 environment: move has_symlinks into repo_config_valuesTian Yuchen, Jul 15, 2026
  37. Christian CouderJul 15, 2026
  38. Junio C HamanoJul 15, 2026
  39. Junio C HamanoJul 15, 2026
  40. 0/4 environment: migrate 'trust_executable_bit' and 'has_symlinks' into 'repo_config_values'Tian Yuchen, Jul 16, 2026
  41. 1/4 read-cache: remove redundant extern declarationsTian Yuchen, Jul 16, 2026
  42. 2/4 read-cache: move 'ce_mode_from_stat()' to 'read-cache.c'Tian Yuchen, Jul 16, 2026
  43. Junio C HamanoJul 16, 2026
  44. 3/4 environment: move trust_executable_bit into repo_config_valuesTian Yuchen, Jul 16, 2026
  45. 4/4 environment: move has_symlinks into repo_config_valuesTian Yuchen, Jul 16, 2026
  46. Junio C HamanoJul 16, 2026
  47. 0/4 environment: migrate 'trust_executable_bit' and 'has_symlinks' into 'repo_config_values'Tian Yuchen, Jul 17, 2026
  48. 2/4 read-cache: pass 'repo' to 'ce_mode_from_stat()'Tian Yuchen, Jul 17, 2026
  49. SZEDER GáborJul 18, 2026
  50. Tian YuchenJul 20, 2026
  51. SZEDER GáborJul 20, 2026
  52. Tian YuchenJul 20, 2026
  53. 1/4 read-cache: remove redundant extern declarationsTian Yuchen, Jul 17, 2026
  54. 3/4 environment: move trust_executable_bit into repo_config_valuesTian Yuchen, Jul 17, 2026
  55. Junio C HamanoJul 17, 2026
  56. Tian YuchenJul 20, 2026
  57. 4/4 environment: move has_symlinks into repo_config_valuesTian Yuchen, Jul 17, 2026
  58. 0/4 environment: migrate 'trust_executable_bit' and 'has_symlinks' into 'repo_config_values'Tian Yuchen, Jul 20, 2026
  59. 1/4 read-cache: remove redundant extern declarationsTian Yuchen, Jul 20, 2026
  60. 2/4 read-cache: pass 'repo' to 'ce_mode_from_stat()'Tian Yuchen, Jul 20, 2026
  61. 3/4 environment: move trust_executable_bit into repo_config_valuesTian Yuchen, Jul 20, 2026
  62. 4/4 environment: move has_symlinks into repo_config_valuesTian Yuchen, Jul 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.