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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Apr 6, 2025 at 12:44 PM Ayush Chandekar <ayu.chandekar@xxxxxxxxx> wrote:
>
> >
> > 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.

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





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux