Re: [PATCH v7 2/2] diff-files: integrate with sparse index
- From
Shuqi Liang <cheskaqiqi@gmail.com>
- Date
- Apr 22, 2023, 21:25 UTC
- Message-ID
- <CAMO4yUEsB=Rnoh44V1dykCkymF6qQJTiQyn_3s=L1PedaUcN7g@mail.gmail.com>
- In-Reply-To
- <111153b4-dba0-b533-fe49-57a6d5d3ba22@github.com>
Hi Victoria,
On Fri, Apr 21, 2023 at 5:26 PM Victoria Dye <vdye@github.com> wrote:
Show 18 quoted lines
> Only the latter represents incorrect behavior. If we're aren't expanding the > index for a case that was causing index expansion before *and* the > user-facing behavior is as-expected, that's the best-case scenario for a > sparse index integration! > > Taking a step back, it's important to remember that the overarching goal of > the project is not just to switch 'command_requires_full_index' to '0' > everywhere, but to find all of the places where Git is working with the > index and make sure that work can be done on a sparse directory. > > In most cases, it's possible to adapt an index-related operation to work > with sparse directories (albeit with varying levels of complexity). The use > of 'ensure_full_index()' is reserved for cases where it is _impossible_ to > make Git perform a given action on a sparse directory - expanding the index > completely eliminates the performance gains had by using a sparse index, so > it should be avoided at all costs. > > I hope that helps!
Thanks for reminding me about the ultimate goal of sparse index integration! I've learned a lot from it. After looking into the test failure, it seems that the index didn't expand in cases where I expected it to. I'll go ahead and update my patch.
Thanks, Shuqi