On 05/05, Johannes Schindelin wrote: > Hi Stefan & Junio, > > On Thu, 4 May 2017, Stefan Beller wrote: > > > So instead of a mechanical replacement, we'd rather want to > > see "the_index" not appearing at all outside of builtins, which > > implies two things: > > > > * If done properly we can move the macros from cache.h to > > e.g. builtin.h. That way future developers are less tempted > > to use the cache_* macros in the library code. > > Yessss! > > > * we'd have to pass through the_index from the builtin function > > down to the library code, potentially going through multiple > > function. For this it is unclear if we want to start this now, or wait > > until Brandon presents his initial repository object struct, which > > may be suited better for passing-around. > > Or the other way round. I guess passing a struct index_state can be a > first step, and we can later convert it to struct repository. I fathom > that more places will need a struct repository parameter than a struct > index_state parameter. That is, if you first identify all the places where > the index_state parameter is required, it should make the struct > repository change easier.
Exactly this. I have a local series which converts ls-files to use a repository struct but it turns out, for that to work, dir.c needs to be converted to take in an index_state struct for fill_directory(). So I then started working on doing that conversion and hopefully will have something clean enough to send out later today for people to comment on. -- Brandon Williams