git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [Outreachy][Proposal]: Refactor in order to reduce Git’s global state

From
Christian Couder <christian.couder@gmail.com>
Date
Oct 30, 2025, 12:55 UTC
Message-ID
<CAP8UFD1v7yec7JwBGekJPvcq7kNJPuPTgWOVn+gBaw1+Sh2mdA@mail.gmail.com>
In-Reply-To
<CAD=f0L8=eBJjj77xBw7m7WcQf80sYbF-X1wbFc9ToC9F0AWVAQ@mail.gmail.com>
On Thu, Oct 30, 2025 at 11:59 AM Bello Olamide <belkid98@gmail.com> wrote:
> On Wed, 29 Oct 2025 at 16:51, Christian Couder
> <christian.couder@gmail.com> wrote:
> > On Wed, Oct 29, 2025 at 2:18 AM Bello Olamide <belkid98@gmail.com> wrote:
Show 19 quoted lines
> > > 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.
Previous: Bello OlamideNext: Bello Olamide
Message 4 of 7 in “[Outreachy][Proposal]: Refactor in order to reduce Git’s global state”
  1. Bello OlamideOct 29, 2025
  2. Christian CouderOct 29, 2025
  3. Bello OlamideOct 30, 2025
  4. Christian CouderOct 30, 2025
  5. Bello OlamideOct 31, 2025
  6. =?y?q?=5BOutreachy=5D=5BProposal=20v2=5D=3A=20Refactor=20in=20order=20to=20reduce=20Git=E2=80=99s=20global=20state?=Olamide Caleb Bello, Oct 30, 2025
  7. Bello OlamideNov 1, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.