Re: [PATCH 0/5] global: drop external `the_index` variable
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 15, 2024, 17:50 UTC
- Message-ID
- <xmqq8r1eo6pz.fsf@gitster.g>
- In-Reply-To
- <28541f00-9054-4aa0-8e47-348043b5f863@gmail.com>
Phillip Wood <phillip.wood123@gmail.com> writes:
Show 6 quoted lines
> Maybe I've got the wrong end of the stick but my impression is that it > is the use of "the_repository" in library code (i.e. the files outside > builtin/) that causes most of the pain. With that in mind would be we > better focusing contributor and reviewer effort on eliminating > "the_repository" from those files instead? It would need to be done in > carefully in stages but would bring real benefits.
I am afraid that it would take a much larger effort.
I have a suspicion that many of the users of the_index do not have to even need that the index_state they work on is connected to any instance of a repository object (in other words, I tend to think that the value of having a pointer to an index_state in an instance of a repository structure is dubious), so in a sense, this rewrite of code that use the_index to use the_repository may be going in a wrong direction. In other words, these functions may eventually want to take a pointer to an index_state structure as their parameters, without having to deal with the whole repository structure, but this rewrite assumes they would eventually want to all work with a repository structure when the_repository dependency is lifted. I'll need to see the codepaths involved more carefully and think about it.
Thanks.