From: Christian Couder Date: Thu, 30 Oct 2025 12:55:14 GMT Subject: Re: [Outreachy][Proposal]: Refactor in order to reduce Git’s global state Message-ID: In-Reply-To: On Thu, Oct 30, 2025 at 11:59 AM Bello Olamide wrote: > On Wed, 29 Oct 2025 at 16:51, Christian Couder > wrote: > > On Wed, Oct 29, 2025 at 2:18 AM Bello Olamide wrote: > > > I also studied [3], [4] by Ayush Chandeker,] and [5] by John Cai to broaden my > > > understanding of the project. > > > > Are there some cases where strategies other than writing new accessors > > functions were used? > > Yes there were cases where the functions were adapted to use > exactly what it needs down the call chain rather than writing new > accessor functions. > An example is > https://public-inbox.org/git/20250306-b4-pks-objects-without-the-repository-v2-1-f3465327be69@pks.im/#Z31csum-file.h > where the global variable `the_hash_algo` is replaced with an explicit parameter > `const struct git_hash_algo *algo` in low-level functions such as > `static struct hashfile *hashfd_internal()` and the call sites adapted > to use r->hash_algo > or the_repository->hash_algo in places where the subsystem has not gotten rid of > `the-repository`. > > This is also a strategy that can be used to replace global variables. Your answers are appreciated, but, just to be clear, I think it would be nice if the answers to my questions like this one were part of a v2 of your proposal. If I don't see a v2, I am less tempted to discuss this further (which could hopefully help move the analysis forward and make your proposal better). Thanks.