On Fri, Jan 1, 2021 at 5:10 AM Derrick Stolee via GitGitGadget <gitgitgadget@xxxxxxxxx> wrote: > > I noticed that Duy's project around USE_THE_INDEX_COMPATIBILITY_MACROS has > been on pause for a while. Here is my attempt to continue that project a > little. > > I started going through the builtins that still use cache_name_pos() and the > first few were easy: merge-inex, mv, rm. > > Then I hit update-index and it was a bit bigger. It's included here as well. > > My strategy for update-index was to create static globals "repo" and > "istate" that point to the_repository and the_index, respectively. Then, I > was able to remove macros one-by-one without changing method prototypes > within the file. > > I had started trying to keep everything local to the method signatures, but > I hit a snag when reaching the command-line parsing callbacks, which I could > not modify their call signature. At that point, I had something that was > already much more complicated than what I present now. Outside of the first > update-index commit, everything was a mechanical find/replace. > > In total, this allows us to remove four of the compatibility macros because > they are no longer used. This series is divided nicely in a way that makes review easy. I've made some of these same types of changes elsewhere, and the whole series is really just a long sequence of mechanical changes (plus a case or two of fixing formatting on a line you were changing anyway, such as adding spaces around an operator). I think the work to continue dropping the implicit dependency on the_index is helpful. I only found two minor suggestions for improving the commit messages; the patches all look good to me.