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
Christian Couder <christian.couder@gmail.com>
Date
Apr 7, 2025, 09:06 UTC
Message-ID
<CAP8UFD0a9rvVEJj4nk0ONK7=HXYRS1td6nEw7nO6mhj4gTjY9g@mail.gmail.com>
In-Reply-To
<CAE7as+atJcycd4Awav6RKkTDvwiocyv4j=0rZvEhDcVpREsmqA@mail.gmail.com>
On Sun, Apr 6, 2025 at 12:44 PM Ayush Chandekar <ayu.chandekar@gmail.com> wrote:
Show 31 quoted lines
>
> >
> > So the approach you suggest is to comb through the global variables and
> > config and find new locations for them to be stored. While this is
> > definitely a bunch chunk of the problem, shouldn't we also talk about
> > how we can reduce usage of some of these variables?
> >
> > In particular, I'm wondering how you'd want to tackle 'the_repository'
> > usage. There is some previous work done here, where Patrick added the
> > '#define USE_THE_REPOSITORY_VARIABLE' definition which tracks usage of
> > global variable and usage of them in different files.
> >
> > A possible approach which has been followed is to simply go from the
> > bottom layers of the code upwards, cleaning up usage of global variables
> > and ensuring we can remove '#define USE_THE_REPOSITORY_VARIABLE' from
> > files. This is also the approach taken in some of the patches that
> > you've linked.
> >
>
> Your approach makes a lot of sense to me, that is, picking a specific
> subsystem or file and aiming to remove the `#define USE_THE_REPOSITORY_VARIABLE`
> definition and thus 'the_repository' eventually. This was the method
> used by Patrick to tackle
> the object subsystem in [1]  and the path subsystem in [2] and you to
> tackle the packfile in [3].
> This approach also helps in removing some of the global variables used
> within that particular
> subsystem, which is a nice bonus.
>
> However, this approach might not be feasible for the global variables that
> arent tightly tied to a single subsystem.

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`?

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.

Show 7 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.

Previous: Ayush ChandekarNext: Ayush Chandekar
Message 10 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.