From: Ayush Chandekar Date: Tue, 01 Jul 2025 23:53:12 GMT Subject: Re: [GSOC PATCH v5 3/3] environment: remove the global variable 'sparse_expect_files_outside_of_patterns' Message-ID: In-Reply-To: <17b7f51c-0c3d-4d63-a501-47ce829f7345@gmail.com> On Tue, Jul 1, 2025 at 6:48 PM Phillip Wood wrote: > > Hi Ayush Hi Phillip, > > On 30/06/2025 20:27, Ayush Chandekar wrote: > > > > void clear_skip_worktree_from_present_files(struct index_state *istate) > > { > > + int sparse_expect_files_outside_of_patterns = 0; > > + repo_config_get_bool(istate->repo, "sparse.expectfilesoutsideofpatterns", > > + &sparse_expect_files_outside_of_patterns); > > This changes the user facing behavior if > sparse.expectfilesoutsideofpatterns is not a valid boolean value. > Currently git will error out when it first starts because that config > value is parsed by git_default_config() which is called by almost all > git commands. This means that if someone sets an invalid value they get > timely feedback that the value is invalid and git dies before doing > anything. Now, if the value is invalid, git will only die if this > function is called and it is likely to die in the middle of a command. > > Thanks > > Phillip > Yes, I get your point. However, if we look at settings which are shifted to `struct repo_settings`, the behaviour is to set a fallback/default value in case of an invalid input, instead of throwing an error. This is done inside the `prepare_repo_settings()` function, which is often called in the middle of a process. Thanks Ayush:)