Thread (27 messages) 27 messages, 4 authors, 2d ago
WARM2d
Revisions (5)
  1. v1 [diff vs current]
  2. v2 [diff vs current]
  3. v4 [diff vs current]
  4. v5 [diff vs current]
  5. v6 current

[PATCH v6 0/1] environment: move excludes_file into repo_config_values

From: Tian Yuchen <hidden>
Date: 2026-07-01 18:08:28

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 V5:

Drop the defensive check in 'repo_excludes_file()'.

All known test errors that occur *without* defensive checks are intercepted
by the 'repo != the_repository' check when checks *are there*, rather than
by the '!repo->initialized' check. In other words, the getter actually doesn't
need any checks added, because all of its calls are safe. We just need to
keep the check and the 'NEEDSWORK' comment *on the destructor* until
'repo_config_values()' eventually supports submodules, at which point we can
remove them.

THANKS!

Mentored-by: Christian Couder [off-list ref]
Mentored-by: Ayush Chandekar [off-list ref]
Mentored-by: Olamide Caleb Bello [off-list ref]
Signed-off-by: Tian Yuchen <redacted>

Tian Yuchen (1):
  environment: move excludes_file into repo_config_values

 dir.c         |  4 ++--
 environment.c | 33 ++++++++++++++++++++++++++++++---
 environment.h | 13 ++++++++++++-
 repository.c  |  1 +
 4 files changed, 45 insertions(+), 6 deletions(-)

-- 
2.43.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help