Re: [RFC 00/14] convert dir.c to take an index parameter
- From
- Jeff Hostetler <git@jeffhostetler.com>
- Date
- May 8, 2017, 18:00 UTC
- Message-ID
- <bf76dd64-0d4b-cadd-cf34-ec50e9d6e351@jeffhostetler.com>
- In-Reply-To
- <20170508171255.GE179149@google.com>
On 5/8/2017 1:12 PM, Brandon Williams wrote:
Show 28 quoted lines
> On 05/06, Junio C Hamano wrote: >> Brandon Williams <bmwill@google.com> writes: >> >>> One of the things brought up on the list in the past few days has been >>> migrating away from using the index compatibility macros. One of the issues >>> brought up in that thread was how simply doing that conversion doesn't >>> eliminate the reliance on global state (specifically the_index). If one day we >>> want to have a 'repository object' passed around then we first need to convert >>> different subsystems to be prepared to handle that. This series provides a >>> first step, converting the code in dir.c to take a 'struct index_state' and >>> using that instead of implicitly using 'the_index'. >> >> Very nicely done (I only skimmed "dir.c" in the end result and didn't >> go through the changes with fine toothed comb, though). >> >> I would have done this without the first step and then instead had a >> final patch that only inserts a single >> >> #define NO_THE_INDEX_COMPATIBILITY_MACROS >> >> at the beginning of dir.c once everybody in dir.c loses the >> reference to all "cache" macros at the end, if I were doing this >> series, but it is a personal taste. >> >> The resulting dir.c does not even refer to the_index, which is very >> nice. > > Thanks! I'm glad there's a few people who see this as a positive change.
Agreed. This looks like a nice start. Jeff