On Sun, Jun 8, 2025 at 2:32 AM Ayush Chandekar <ayu.chandekar@xxxxxxxxx> wrote: > > The setting "core.sparsecheckout" is stored in the global > `core_apply_sparse_checkout` and is populated in config.c. Refactor the > code to store it in the variable `sparse_checkout` in the struct > `repo_settings`. Also, create functions to set and get the value of the > setting and update all the occurrences. > > This also allows us to remove the definition `#define > USE_THE_REPOSITORY_VARIABLE` from the file 'builtin/backfill.c'. > > This change is part of an ongoing effort to eliminate global variables, > improve modularity and help libify the codebase. > > Signed-off-by: Ayush Chandekar <ayu.chandekar@xxxxxxxxx> > --- When sending a v2 like this one, it's nice if you can describe what changed since v1 here, after the line starting with 3 dashes "---". Providing a range-diff here, when it makes sense, could be a good idea and help reviewers too. Speaking of reviewers, thanking or just mentioning them is nice too while at it. > builtin/backfill.c | 5 +---- > builtin/clone.c | 2 +- > builtin/grep.c | 2 +- > builtin/mv.c | 2 +- > builtin/sparse-checkout.c | 20 ++++++++++---------- > builtin/worktree.c | 2 +- > config.c | 5 ----- > dir.c | 2 +- > environment.c | 1 - > environment.h | 1 - > repo-settings.c | 13 +++++++++++++ > repo-settings.h | 5 +++++ > sparse-index.c | 4 ++-- > unpack-trees.c | 2 +- > wt-status.c | 2 +- > 15 files changed, 38 insertions(+), 30 deletions(-)