On 1/1/2021 4:05 PM, Elijah Newren wrote: > On Fri, Jan 1, 2021 at 5:10 AM Derrick Stolee via GitGitGadget > <gitgitgadget@xxxxxxxxx> wrote: >> >> From: Derrick Stolee <dstolee@xxxxxxxxxxxxx> >> >> To reduce the need for the index compatibility macros, we will replace >> their uses in update-index mechanically. This is the most interesting >> change, which creates global "repo" and "istate" pointers. The macros >> can then be mechanically replaced by instances that use the istate >> pointer instead of the version that autocompletes to use the_index. > > autocompletes seems a bit weird to me here. Perhaps s/autocompletes > to use/implicitly uses/ ? My intention was "instead of the macro expansion that uses the_index". The preprocessor is really just an early version of autocomplete, right? Thanks. > Also, it seems like in the last few patches you just used > the_repository whereas here you're trying to avoid it. Is that > because there are more uses here and only one in the other patches? My goal isn't to remove the_repository, but the earlier patches also avoided static globals in favor of method parameters. I needed to change the strategy for update-index because of the vast number of methods needing an update. Since I was making a static global for the current index, it was not a huge step to also add one for the current repository. Further, the cmd_update_index() already had a local pointer that replaced using the_repository, giving me some reason to include the_repository in these updates. > Otherwise, all the changes in this patch (and the other ones I've read > so far; going through them in order) seem like the obvious mechanical > changes necessary to update to avoid the index compatibility macros. > So, looking good so far. Thanks, -Stolee