[PATCH v11 00/10] migrate more variables into repo_config_values
From: Tian Yuchen <hidden>
Date: 2026-07-13 03:57:47
Hi everyone, This patch series continues the ongoing libification effort by migrating a batch of global configuration variables into struct repo_config_values. What does this series do: infrastructure & strings (commits 1-6): Introduce 'repo_config_values_clear()' to manage the lifecycle of heap-allocated configuration strings. This infrastructure is utilized to migrate string variables, including 'excludes_file', 'apply' whitespace configs, and external programs including 'editor', 'pager', 'askpass'. enums (commits 7-9): Migrate enumerations 'push_default', 'autorebase', and 'object_creation_mode'. Care was taken to make these types available to the configuration structure without triggering circular header dependencies. edit comment (commit 10): Adjust the comment for config_values_private_ in repository.h. RFC: Commit 3~5. Is it really necessary to migrate _program variables? https://lore.kernel.org/git/8e657184-ee0b-453a-9f2d-a98080d3582e@gmail.com/ (local) Commit 6~9. Previous related discussions on 'git_branch_track'. https://lore.kernel.org/git/CAD=f0L-mPX+KECUjXk-WBzEbTP7wCa8sB56GySQT0yh9mfUOWw@mail.gmail.com/ (local) Note: Since a new getter 'repo_excludes_file()' is introduced, as previously promised, once it is finally merged into 'master', there will be a patch to update and squash the comments. Similarly, I've noticed that the classification and sorting of variables in 'repo_config_values' don't seem to be correct. There will also be a patch to fix this, and I think it will form a commit series along with the comment patch? Changes since v10: - use repo_config_values *cfg to avoid multiple calls to repo_config_values() and avoid overly long lines. - drop the extern declarations for askpass_program. - in the commit message of pager_program migration, mention that the new assertion is fine since current callers pass the_repository only. - add FREE_AND_NULL()s before repo_config_get_strings() calls. - create a new commit to adjust the comment for config_values_private_ since it was no longer true. Special thanks to Pablo and Junio! Tian Yuchen (10): repository: introduce repo_config_values_clear() environment: move excludes_file into repo_config_values environment: move editor_program into repo_config_values environment: move pager_program into repo_config_values environment: move askpass_program into repo_config_values environment: migrate apply_default_whitespace and apply_default_ignorewhitespace environment: move push_default into repo_config_values environment: move autorebase into repo_config_values environment: move object_creation_mode into repo_config_values repository: adjust the comment of config_values_private_ apply.c | 28 ++++++++++++------ branch.c | 2 +- builtin/push.c | 10 ++++--- dir.c | 4 +-- editor.c | 4 +-- environment.c | 76 ++++++++++++++++++++++++++++++++----------------- environment.h | 77 ++++++++++++++++++++++++++++++-------------------- object-file.c | 3 +- pager.c | 32 +++++++++++++++------ prompt.c | 3 +- remote.c | 2 +- repository.c | 1 + repository.h | 2 +- 13 files changed, 158 insertions(+), 86 deletions(-) -- 2.43.0