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

Re: [PATCH 0/5] Start of a journey: drop NO_THE_INDEX_COMPATIBILITY_MACROS

From
BWBrandon Williams <bmwill@google.com>
Date
May 5, 2017, 17:29 UTC
Message-ID
<20170505172956.GB55152@google.com>
In-Reply-To
<xmqq8tmb8bhu.fsf@gitster.mtv.corp.google.com>
On 05/05, Junio C Hamano wrote:
Show 30 quoted lines
> Jonathan Nieder <jrnieder@gmail.com> writes:
> 
> > That is, one way to do what this series attempts would be the
> > following:
> >
> >  1. rename variables that shadow the_index.
> 
> No question about this one.  It is a good thing to do.
> 
> >  2. add coccinelle patches (or one coccinelle patch) to
> >     contrib/coccinelle implementing *_cache -> *_index migration.
> >     Is there a way to do this without making it fail "make coccicheck"?
> 
> Quite honestly, I do not see much value in this, but take it merely
> as my knee-jerk reaction.  The only scenario I can think of in which
> dropping *_cache() macros is an improvement as the end result is
> when our goal is to completely drop the singleton index_state
> instance, aka "the_index".  I actually think that it may be a
> worthwhile goal to eradicate "the_index".
> 
> I wonder if somebody can take a small example codepath and make it
> not to rely on the existence of "the_index" from start to end?  Have
> an instance of index_state on the stack of cmd_foo(), have it call
> read_index() into it where it currently calls read_cache(), update
> the support functions it calls so that it can pass the pointer to
> its index_info throughout the callchain, and see how involved the
> necessary changes of all of the above are.  Start from something
> simple and small, e.g. "ls-files".  The infrastructure code updated
> for such an experiment may be NO_THE_INDEX_COMPATIBILITY_MACROS
> clean.

I've mentioned elsewhere but I've been working on this for 'ls-files'. There's quite a few "gotchas" but its given me a good idea of which sections of code need to be converted to taking in a 'struct index_state'. I'll send some of this conversion out later today as a RFC and see what people think about it and if its worth while to continue.

-- 
Brandon Williams
Previous: Junio C HamanoNext: Jeff Hostetler
Message 23 of 25 in “Start of a journey: drop NO_THE_INDEX_COMPATIBILITY_MACROS”
  1. 0/5 Start of a journey: drop NO_THE_INDEX_COMPATIBILITY_MACROSStefan Beller, May 1, 2017
  2. 1/5 cache.h: drop read_cache()Stefan Beller, May 1, 2017
  3. 2/5 cache.h: drop active_* macrosStefan Beller, May 1, 2017
  4. 3/5 cache.h: drop read_cache_fromStefan Beller, May 1, 2017
  5. 4/5 cache.h: drop read_cache_preload(pathspec)Stefan Beller, May 1, 2017
  6. 5/5 cache.h: drop read_cache_unmerged()Stefan Beller, May 1, 2017
  7. Junio C HamanoMay 2, 2017
  8. Stefan BellerMay 2, 2017
  9. Jeff HostetlerMay 2, 2017
  10. Samuel LijinMay 3, 2017
  11. Stefan BellerMay 3, 2017
  12. Samuel LijinMay 3, 2017
  13. Brandon WilliamsMay 4, 2017
  14. Duy NguyenMay 3, 2017
  15. Stefan BellerMay 3, 2017
  16. Junio C HamanoMay 4, 2017
  17. Brandon WilliamsMay 4, 2017
  18. Stefan BellerMay 4, 2017
  19. Johannes SchindelinMay 5, 2017
  20. Brandon WilliamsMay 5, 2017
  21. Jonathan NiederMay 4, 2017
  22. Junio C HamanoMay 5, 2017
  23. Brandon WilliamsMay 5, 2017
  24. Jeff HostetlerMay 2, 2017
  25. Stefan BellerMay 2, 2017

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.