[PATCH v5 0/1] environment: move excludes_file into repo_config_values
- From
Tian Yuchen <cat@malon.dev>
- Date
- Jun 30, 2026, 16:44 UTC
- Message-ID
- <20260630164401.2906091-1-cat@malon.dev>
- In-Reply-To
- <20260627160813.1074201-1-cat@malon.dev>
This patch continues the libification effort by migrating the global string variable 'excludes_file' into 'struct repo_config_values'. Since this is a dynamically allocated variable, the migration requires proper heap memory management.
This patch mainly does three things:
- Abstract the XDG fallback lazy-loading logic out of dir.c into a proper getter.
- Move the variables into the struct repo_config_values.
- Introduce the memory destructor 'repo_config_values_clear()'.
Changes since V4:
Defensive checks are retained in both the getter (returning NULL if uninitialized) and the destructor (bypassing non-the_repository instances) to maintain bug-to-bug compatibility. These are marked with 'NEEDSWORK' comments.
Future work will track down and fix the offending callers to eventually replace these shields with stricter BUG() assertions. [1]
THANKS!
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>
[1] https://lore.kernel.org/git/054b3fb6-0e69-473d-9778-b1b11ea82b3a@malon.dev/T/#mca0730b6735298316ec00a53d4719935d18837a6
Tian Yuchen (1): environment: move excludes_file into repo_config_values
dir.c | 4 ++-- environment.c | 43 ++++++++++++++++++++++++++++++++++++++++--- environment.h | 13 ++++++++++++- repository.c | 1 + 4 files changed, 55 insertions(+), 6 deletions(-)
-- 2.43.0