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

Re: [GSOC] [PROPOSAL v2]: Refactoring in order to reduce Git’s global state

From
Ayush Chandekar <ayu.chandekar@gmail.com>
Date
Apr 7, 2025, 10:07 UTC
Message-ID
<CAE7as+bnsBMW=UQtzQrNKTK3cMDSyYP=Q1EqEb2z8-ur3_my5w@mail.gmail.com>
In-Reply-To
<CAP8UFD0a9rvVEJj4nk0ONK7=HXYRS1td6nEw7nO6mhj4gTjY9g@mail.gmail.com>
Show 8 quoted lines
>
> Well, initially 'the_repository' wasn't tightly tied to a single
> subsystem and even now I am not sure we could say it's tightly tied to
> a single subsystem. Or maybe I don't understand what you mean.
>
> Do you mean that it's tightly tied because it needs `#define
> USE_THE_REPOSITORY_VARIABLE`?
>

Sorry if I was not clear earlier. I wasn't referring to 'the_repository' being tied, it was about other global variables being tied to a subsystem. What I meant is that the approach of picking a subsystem and removing the `#define USE_THE_REPOSITORY_VARIABLE` is really effective for removing 'the_repository.' It also helps in localizing the global variables from environment.h that are specific to that subsystem, either into the subsystem itself or into struct repository / repo_settings.

But let's say if a global variable is common to 2-3 different subsystems, then this approach would not be feasible for that variable. For that, I would require to individually tackle that variable. This is an approach which I mentioned in my proposal.

So using these two approaches according to different needs, I can move forward.
> But for other global variables it could be possible to define and use
> similar macros. This way it might be possible to remove those
> variables step by step only in some files.
>

Yes, I still need to think through how that would align with the approach I mentioned. Defining a single macro like `#define USE_GLOBAL_VARIABLES` is something I can look into.

Show 10 quoted lines
> > So what I can do is, for removing
> > `the_repository`, I can follow the approach you mentioned, and for relocating
> > the more general global variables, I can use the approach which I
> > talked about in the
> > proposal.
> >
> > What do you think?
>
> If removing `the_repository` is part of your proposal, then yeah,
> describing the approach you will use to remove is a good idea.

Yes, it is a part of the project but I haven't added this specific approach in the proposal yet and was hence asking if I can. Thanks:)

Previous: Christian CouderNext: Ayush Chandekar
Message 11 of 13 in “[GSOC] [PROPOSAL V1]: Refactoring in order to reduce Git’s global state”
  1. Ayush ChandekarMar 26, 2025
  2. shejialuoMar 28, 2025
  3. Ayush ChandekarMar 29, 2025
  4. shejialuoMar 31, 2025
  5. Ayush ChandekarMar 31, 2025
  6. Ayush ChandekarMar 31, 2025
  7. [GSOC] [PROPOSAL v2]: Refactoring in order to reduce Git’s global stateAyush Chandekar, Apr 4, 2025
  8. Karthik NayakApr 4, 2025
  9. Ayush ChandekarApr 6, 2025
  10. Christian CouderApr 7, 2025
  11. Ayush ChandekarApr 7, 2025
  12. Ayush ChandekarApr 7, 2025
  13. [GSOC] [PROPOSAL v3]: Refactoring in order to reduce Git’s global stateAyush Chandekar, Apr 8, 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.