[PATCH v7 0/9] migrate more variables into repo_config_values
From: Tian Yuchen <hidden>
Date: 2026-07-06 14:25:54
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. 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 v6: Only the first two commits in this patch overlap with v6. The reason the subsequent commits were not released separately is that Christian suggested placing the introduction of 'repo_config_values_clear()' as a standalone commit at the very beginning. In other words, the v6 structure has been discarded, and this series is being released as almost a new patch. Thanks! Tian Yuchen (9): 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 apply.c | 20 +++++++----- branch.c | 2 +- builtin/push.c | 8 ++--- dir.c | 4 +-- editor.c | 4 +-- environment.c | 87 +++++++++++++++++++++++++++++++++++--------------- environment.h | 75 +++++++++++++++++++++++++++---------------- object-file.c | 2 +- pager.c | 17 ++++++---- prompt.c | 3 +- remote.c | 2 +- repository.c | 1 + 12 files changed, 145 insertions(+), 80 deletions(-) -- 2.43.0