Re: [Outreachy][Proposal]: Refactor in order to reduce Git’s global state
- From
Bello Olamide <belkid98@gmail.com>
- Date
- Oct 31, 2025, 11:43 UTC
- Message-ID
- <CAD=f0L8aMT+Qjgk4Gij1fVCVjKSyGfWS_tb6O54PT1=4KpbRJA@mail.gmail.com>
- In-Reply-To
- <CAP8UFD1v7yec7JwBGekJPvcq7kNJPuPTgWOVn+gBaw1+Sh2mdA@mail.gmail.com>
On Thu, 30 Oct 2025 at 13:55, Christian Couder <christian.couder@gmail.com> wrote:
Show 22 quoted lines
> > > 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.
Hello Christian Thank you very much. I have added the answers to your question and submitted a v2 of the proposal.
Bello