Re: [GSOC PATCH v6 0/3] environment: remove sparse-checkout related global variables
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 24, 2025, 18:44 UTC
- Message-ID
- <xmqq7bzxh1j6.fsf@gitster.g>
- In-Reply-To
- <43aaec10-2696-44c9-8728-2045b83dc5d3@gmail.com>
Derrick Stolee <stolee@gmail.com> writes:
Show 19 quoted lines
> There are two ways to change the approach here to fix the problem > of needing prepare_repo_settings() everyhwere: > > 1. With the idea that these sparse-checkout variables are > critical to the functionality of the repo, they should move > into the repository struct itself and be initialized along > with all other values there. This changes the patches (and my > follow-up series) significantly, but mechanically. > > 2. If we are going to change the intention of the repo settings > struct to move from "optional one-off feature flags" to > "important information about the core behavior of a repo" > then we should prepare_repo_settings() when initializing the > repository struct. > > My preference is (1). The only argument for (2) that I can think > of is that it is sometimes helpful to share only the settings for > a repo without sharing the whole repo. But that seems like a weak > reason right now.
I do agree with the sentiment that being able to pass &repo.settings to helper function makes us feel safer, but I agree that it is a weak argument. If we reexamine other things in repo_settings, it may turn out that the same reasoning applies to them and we may be better off to roll repo_settings into the repository itself (after all, it is an embedded structure, not even a pointer in the main structure that points at an indenendent repo_settings structure), but that is totally outside the scope of this discussion.
Thanks.