Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bisect new 1 #410

Closed
wants to merge 6 commits into from
Closed

Bisect new 1 #410

wants to merge 6 commits into from

Conversation

pranitbauva1997
Copy link
Contributor

Using submitGit to send patch series.

`--next-all` is meant to be used as a subcommand to support multiple
"operation mode" though the current implementation does not contain any
other subcommand along side with `--next-all` but further commits will
include some more subcommands.

Helped-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Mentored-by: Lars Schneider <larsxschneider@gmail.com>
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com>

---
Hey,

It has been a long time since this series appeared on the mailing list.
The previous version v15[1] is now split into many parts and I am
sending the first part right now, will focus on getting this merged and
then send out the next part.

The changes in this part:
 * Stephan pointed out that "terms" was missing in patch 2 ie.
   "bisect--helper: rewrite `check_term_format` shell function in C"

[1]:
https://public-inbox.org/git/CAFZEwPOjK25m84BgTF7AL72DL_K1dHf7OrYoX=_vky9r3GayNw@mail.gmail.com/
Reimplement the `check_term_format` shell function in C and add
a `--check-term-format` subcommand to `git bisect--helper` to call it
from git-bisect.sh

Using `--check-term-format` subcommand is a temporary measure to port
shell function to C so as to use the existing test suite. As more
functions are ported, this subcommand will be retired and its
implementation will be called by some other method/subcommand. For
eg. In conversion of write_terms() of git-bisect.sh, the subcommand will
be removed and instead check_term_format() will be called in its C
implementation while a new subcommand will be introduced for write_terms().

Helped-by: Johannes Schindelein <Johannes.Schindelein@gmx.de>
Mentored-by: Lars Schneider <larsxschneider@gmail.com>
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com>
Reimplement the `write_terms` shell function in C and add a `write-terms`
subcommand to `git bisect--helper` to call it from git-bisect.sh . Also
remove the subcommand `--check-term-format` as it can now be called from
inside the function write_terms() C implementation.

Also `|| exit` is added when calling write-terms subcommand from
git-bisect.sh so as to exit whenever there is an error.

Using `--write-terms` subcommand is a temporary measure to port shell
function to C so as to use the existing test suite. As more functions
are ported, this subcommand will be retired and its implementation will
be called by some other method.

Mentored-by: Lars Schneider <larsxschneider@gmail.com>
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com>
Reimplement `bisect_clean_state` shell function in C and add a
`bisect-clean-state` subcommand to `git bisect--helper` to call it from
git-bisect.sh .

Using `--bisect-clean-state` subcommand is a measure to port shell
function to C so as to use the existing test suite. As more functions
are ported, this subcommand will be retired but its implementation  will
be called by bisect_reset() and bisect_start().

Also introduce a function `mark_for_removal` to store the refs which
need to be removed while iterating through the refs.

Mentored-by: Lars Schneider <larsxschneider@gmail.com>
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com>
Add test to explicitly check that 'git bisect reset' is working as
expected. This is already covered implicitly by the test suite.

Mentored-by: Lars Schneider <larsxschneider@gmail.com>
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com>

---
I faced this problem while converting `bisect_clean_state` and the tests
where showing breakages but it wasn't clear as to where exactly are they
breaking. This will patch  will help in that. Also I tested the test
coverage of the test suite before this patch and it covers this (I did
this by purposely changing names of files in git-bisect.sh and running
the test suite).
…ion in C

Reimplement `is_expected_rev` & `check_expected_revs` shell function in
C and add a `--check-expected-revs` subcommand to `git bisect--helper` to
call it from git-bisect.sh .

Using `--check-expected-revs` subcommand is a temporary measure to port
shell functions to C so as to use the existing test suite. As more
functions are ported, this subcommand would be retired but its
implementation will be called by some other method.

Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Mentored-by: Lars Schneider <larsxschneider@gmail.com>
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com>
@submitgit
Copy link
Member

@pranitbauva1997 sent these 6 commits (ea220ee...b987cd7) as a set of patches to the mailing list with submitGit - here on public-inbox, MARC

@dscho
Copy link
Member

dscho commented Jun 3, 2019

Wasn't this integrated into master already?

@pranitbauva1997
Copy link
Contributor Author

@dscho Yes. Closing this.

derrickstolee added a commit to derrickstolee/git that referenced this pull request Aug 26, 2021
```
6e74958 p2000: add 'git checkout -' test and decrease depth
3e1d03c p2000: compress repo names
cd94f82 commit: integrate with sparse-index
65e79b8 sparse-index: recompute cache-tree
e9a9981 checkout: stop expanding sparse indexes
4b801c8 t1092: document bad 'git checkout' behavior
71e3015 unpack-trees: resolve sparse-directory/file conflicts
5e96df4 t1092: test merge conflicts outside cone
defab1b add: allow operating on a sparse-only index
9fc4313 pathspec: stop calling ensure_full_index
0ec03ab add: ignore outside the sparse-checkout in refresh()
adf5b15 add: remove ensure_full_index() with --renormalize
```

These commits are equivalent to those already in `next` via gitgitgadget#999.

```
80b8d6c Merge branch 'sparse-index/add' into stolee/sparse-index/add
```

This merge resolves conflicts with some work that happened in parallel, but is already in upstream `master`.

```
c407b2c t7519: rewrite sparse index test
9dad0d2 sparse-index: silently return when not using cone-mode patterns
2974920 sparse-index: silently return when cache tree fails
e7cdaa0 unpack-trees: fix nested sparse-dir search
347410c sparse-checkout: create helper methods
4537233 attr: be careful about sparse directories
5282a86 sparse-index: add SPARSE_INDEX_MEMORY_ONLY flag
3a2f316 sparse-checkout: clear tracked sparse dirs
fb47b56 sparse-checkout: add config to disable deleting dirs
```

These commits are the ones under review as of gitgitgadget#1009. Recent review made this less stable. It's a slightly different and more robust version of git#396.

> Note: I'm still not done with the feedback for upstream, but the remaining feedback is "can we add tests that cover these tricky technical bits?" and in `microsoft/git` these are already covered by the Scalar functional tests (since that's how they were found).

```
080b02c diff: ignore sparse paths in diffstat
d91a647 merge: make sparse-aware with ORT
df49b5f merge-ort: expand only for out-of-cone conflicts
cdecb85 t1092: add cherry-pick, rebase tests
0c1ecfb sequencer: ensure full index if not ORT strategy
406dfbe sparse-index: integrate with cherry-pick and rebase
```

These commits integrate with `git merge`, `git cherry-pick`, `git revert`, and `git rebase` as of gitgitgadget#1019. This got some feedback that changed how the tests were working so they are more robust. This led to a new commit (0c1ecfb).

```
cbb0ab3 Merge branch 'sparse-index/merge' into vfs-2.33.0
acb8623 t7524: test no longer fails
```

Finally, the commits are merged into `vfs-2.33.0` and also we include a fix to a `microsoft/git` test that is no longer broken.

Cc: @vdye and @ldennington to get a (possibly overwhelming?) taste of sparse-index stuff. If you focus solely on the `git merge` commits you'll get a feel for what a sparse index integration looks like.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Aug 26, 2021
This branch is exactly git#410, but with one more commit: enabling the sparse index by default in d59110a.

Having this in the `vfs-2.33.0` branch helps build confidence that the sparse index is doing what it should be doing by running in the Scalar functional tests and in our test branches.

If we want to cut a new `microsoft/git` release without enabling the sparse index, we can simply revert this commit.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Sep 21, 2021
One thing I forgot when talking about the sparse index is that we have a performance test: `t/perf/p2000-sparse-operations.sh`. This test wasn't helpful for commands like `git merge` that need a particular set of input, but work for more read-only operations.

Here is a quick demonstration of how this performance test works so we could have a definitive measure of how your previous updates improved performance. 

To get these results, I ran the following command in `t/perf`:

```
 ./run 4bcd533 f9255a5 f28fc01 b713582 -- p2000-sparse-operations.sh
```

The short-shas correspond to the merge commits for these PRs:

* git#410 
* git#421 
* git#417 
* git#419

The test takes a copy of the Git repository and creates several copies within a nested directory heirarchy.


```
Test                                                   4bcd533       f9255a5              f28fc01              b713582           
-------------------------------------------------------------------------------------------------------------------------------------------------
2000.2: git status (full-v3)                           0.19(0.15+0.05)   0.19(0.16+0.05) +0.0%    0.20(0.18+0.03) +5.3%    0.19(0.17+0.04) +0.0% 
2000.3: git status (full-v4)                           0.20(0.18+0.04)   0.19(0.15+0.06) -5.0%    0.21(0.18+0.05) +5.0%    0.18(0.18+0.02) -10.0%
2000.4: git status (sparse-v3)                         0.04(0.04+0.04)   0.05(0.07+0.04) +25.0%   0.04(0.04+0.05) +0.0%    0.04(0.06+0.04) +0.0% 
2000.5: git status (sparse-v4)                         0.04(0.03+0.06)   0.04(0.05+0.05) +0.0%    0.05(0.05+0.04) +25.0%   0.05(0.06+0.04) +25.0%
2000.6: git add -A (full-v3)                           0.36(0.29+0.05)   0.38(0.28+0.07) +5.6%    0.36(0.31+0.05) +0.0%    0.37(0.31+0.05) +2.8% 
2000.7: git add -A (full-v4)                           0.34(0.27+0.06)   0.34(0.29+0.05) +0.0%    0.34(0.29+0.04) +0.0%    0.35(0.28+0.06) +2.9% 
2000.8: git add -A (sparse-v3)                         0.06(0.07+0.04)   0.06(0.05+0.06) +0.0%    0.06(0.09+0.01) +0.0%    0.06(0.08+0.03) +0.0% 
2000.9: git add -A (sparse-v4)                         0.05(0.05+0.04)   0.05(0.05+0.07) +0.0%    0.05(0.04+0.06) +0.0%    0.06(0.06+0.05) +20.0%
2000.10: git add . (full-v3)                           0.38(0.31+0.05)   0.37(0.29+0.06) -2.6%    0.37(0.30+0.07) -2.6%    0.37(0.29+0.06) -2.6% 
2000.11: git add . (full-v4)                           0.35(0.31+0.04)   0.35(0.29+0.07) +0.0%    0.35(0.29+0.05) +0.0%    0.34(0.29+0.06) -2.9% 
2000.12: git add . (sparse-v3)                         0.06(0.06+0.05)   0.06(0.05+0.06) +0.0%    0.06(0.07+0.05) +0.0%    0.06(0.09+0.03) +0.0% 
2000.13: git add . (sparse-v4)                         0.06(0.06+0.06)   0.06(0.07+0.04) +0.0%    0.05(0.06+0.05) -16.7%   0.05(0.05+0.07) -16.7%
2000.14: git commit -a -m A (full-v3)                  0.48(0.37+0.08)   0.45(0.36+0.08) -6.2%    0.45(0.35+0.09) -6.2%    0.44(0.36+0.07) -8.3% 
2000.15: git commit -a -m A (full-v4)                  0.45(0.40+0.06)   0.43(0.34+0.07) -4.4%    0.45(0.37+0.06) +0.0%    0.42(0.36+0.05) -6.7% 
2000.16: git commit -a -m A (sparse-v3)                0.05(0.05+0.06)   0.05(0.05+0.03) +0.0%    0.05(0.06+0.06) +0.0%    0.05(0.04+0.06) +0.0% 
2000.17: git commit -a -m A (sparse-v4)                0.05(0.06+0.03)   0.05(0.06+0.04) +0.0%    0.06(0.07+0.05) +20.0%   0.05(0.04+0.06) +0.0% 
2000.18: git checkout -f - (full-v3)                   0.55(0.43+0.08)   0.54(0.46+0.05) -1.8%    0.55(0.46+0.07) +0.0%    0.54(0.40+0.10) -1.8% 
2000.19: git checkout -f - (full-v4)                   0.55(0.41+0.09)   0.50(0.40+0.09) -9.1%    0.51(0.46+0.05) -7.3%    0.51(0.44+0.06) -7.3% 
2000.20: git checkout -f - (sparse-v3)                 0.06(0.09+0.03)   0.06(0.08+0.03) +0.0%    0.06(0.06+0.05) +0.0%    0.07(0.09+0.03) +16.7%
2000.21: git checkout -f - (sparse-v4)                 0.06(0.08+0.04)   0.05(0.07+0.05) -16.7%   0.05(0.07+0.04) -16.7%   0.06(0.09+0.03) +0.0% 
```

All of the above were already integrated.

```
2000.22: git reset (full-v3)                           0.41(0.32+0.06)   0.40(0.31+0.06) -2.4%    0.41(0.33+0.05) +0.0%    0.42(0.34+0.04) +2.4% 
2000.23: git reset (full-v4)                           0.37(0.32+0.05)   0.35(0.30+0.05) -5.4%    0.37(0.30+0.05) +0.0%    0.35(0.31+0.03) -5.4% 
2000.24: git reset (sparse-v3)                         0.68(0.65+0.05)   0.55(0.52+0.04) -19.1%   0.04(0.05+0.04) -94.1%   0.04(0.05+0.04) -94.1%
2000.25: git reset (sparse-v4)                         0.70(0.65+0.05)   0.54(0.50+0.06) -22.9%   0.04(0.07+0.01) -94.3%   0.03(0.05+0.05) -95.7%
2000.26: git reset --hard (full-v3)                    0.54(0.43+0.07)   0.53(0.43+0.06) -1.9%    0.55(0.46+0.05) +1.9%    0.55(0.44+0.06) +1.9% 
2000.27: git reset --hard (full-v4)                    0.50(0.45+0.03)   0.50(0.43+0.05) +0.0%    0.49(0.41+0.06) -2.0%    0.50(0.42+0.05) +0.0% 
2000.28: git reset --hard (sparse-v3)                  0.83(0.76+0.06)   0.68(0.62+0.05) -18.1%   0.07(0.05+0.02) -91.6%   0.07(0.05+0.02) -91.6%
2000.29: git reset --hard (sparse-v4)                  0.80(0.75+0.05)   0.69(0.62+0.06) -13.8%   0.07(0.04+0.02) -91.2%   0.07(0.04+0.03) -91.2%
```

As expected, `git reset [--hard]` improves with the sparse index integration, but remains constant across the full index case.

```
2000.30: git update-index --add --remove (full-v3)     0.03(0.01+0.01)   0.03(0.02+0.01) +0.0%    0.03(0.02+0.01) +0.0%    0.03(0.01+0.01) +0.0% 
2000.31: git update-index --add --remove (full-v4)     0.03(0.02+0.01)   0.03(0.02+0.01) +0.0%    0.03(0.03+0.00) +0.0%    0.03(0.02+0.01) +0.0% 
2000.32: git update-index --add --remove (sparse-v3)   0.57(0.54+0.02)   0.43(0.42+0.00) -24.6%   0.44(0.41+0.03) -22.8%   0.44(0.42+0.01) -22.8%
2000.33: git update-index --add --remove (sparse-v4)   0.56(0.52+0.04)   0.43(0.42+0.01) -23.2%   0.44(0.42+0.02) -21.4%   0.42(0.41+0.01) -25.0%
```

These do not change significantly because git#423 is not merged.

```
2000.34: git diff (full-v3)                            0.07(0.05+0.03)   0.06(0.05+0.03) -14.3%   0.07(0.05+0.03) +0.0%    0.06(0.05+0.03) -14.3%
2000.35: git diff (full-v4)                            0.06(0.05+0.03)   0.06(0.05+0.02) +0.0%    0.06(0.05+0.02) +0.0%    0.06(0.06+0.02) +0.0% 
2000.36: git diff (sparse-v3)                          0.25(0.23+0.03)   0.17(0.17+0.02) -32.0%   0.18(0.18+0.02) -28.0%   0.01(0.03+0.03) -96.0%
2000.37: git diff (sparse-v4)                          0.25(0.22+0.05)   0.16(0.16+0.01) -36.0%   0.18(0.15+0.04) -28.0%   0.01(0.04+0.02) -96.0%
2000.38: git diff --staged (full-v3)                   0.03(0.01+0.01)   0.03(0.02+0.01) +0.0%    0.03(0.02+0.01) +0.0%    0.03(0.02+0.00) +0.0% 
2000.39: git diff --staged (full-v4)                   0.04(0.03+0.01)   0.03(0.02+0.01) -25.0%   0.03(0.03+0.00) -25.0%   0.03(0.03+0.00) -25.0%
2000.40: git diff --staged (sparse-v3)                 0.21(0.19+0.01)   0.15(0.13+0.01) -28.6%   0.15(0.14+0.01) -28.6%   0.01(0.01+0.00) -95.2%
2000.41: git diff --staged (sparse-v4)                 0.22(0.21+0.01)   0.14(0.11+0.03) -36.4%   0.15(0.13+0.02) -31.8%   0.01(0.01+0.00) -95.5%
```

The `git diff` improvements are measurable.

```
2000.42: git sparse-checkout reapply (full-v3)         0.63(0.54+0.05)   0.56(0.48+0.04) -11.1%   0.57(0.48+0.03) -9.5%    0.59(0.48+0.05) -6.3% 
2000.43: git sparse-checkout reapply (full-v4)         0.60(0.54+0.02)   0.51(0.46+0.03) -15.0%   0.54(0.48+0.02) -10.0%   0.50(0.44+0.04) -16.7%
2000.44: git sparse-checkout reapply (sparse-v3)       0.91(0.86+0.05)   0.05(0.05+0.00) -94.5%   0.06(0.05+0.01) -93.4%   0.06(0.06+0.00) -93.4%
2000.45: git sparse-checkout reapply (sparse-v4)       0.92(0.88+0.04)   0.05(0.05+0.00) -94.6%   0.05(0.05+0.01) -94.6%   0.05(0.04+0.01) -94.6%
```

Finally, the `git sparse-checkout` measurements are also present.

This test script is particularly valuable when contributing changes upstream. It can be good to start by adding the lines to the performance test in an early commit, then demonstrating the performance change by copying the necessary lines from the output table into your commit message.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Nov 2, 2021
```
6e74958 p2000: add 'git checkout -' test and decrease depth
3e1d03c p2000: compress repo names
cd94f82 commit: integrate with sparse-index
65e79b8 sparse-index: recompute cache-tree
e9a9981 checkout: stop expanding sparse indexes
4b801c8 t1092: document bad 'git checkout' behavior
71e3015 unpack-trees: resolve sparse-directory/file conflicts
5e96df4 t1092: test merge conflicts outside cone
defab1b add: allow operating on a sparse-only index
9fc4313 pathspec: stop calling ensure_full_index
0ec03ab add: ignore outside the sparse-checkout in refresh()
adf5b15 add: remove ensure_full_index() with --renormalize
```

These commits are equivalent to those already in `next` via gitgitgadget#999.

```
80b8d6c Merge branch 'sparse-index/add' into stolee/sparse-index/add
```

This merge resolves conflicts with some work that happened in parallel, but is already in upstream `master`.

```
c407b2c t7519: rewrite sparse index test
9dad0d2 sparse-index: silently return when not using cone-mode patterns
2974920 sparse-index: silently return when cache tree fails
e7cdaa0 unpack-trees: fix nested sparse-dir search
347410c sparse-checkout: create helper methods
4537233 attr: be careful about sparse directories
5282a86 sparse-index: add SPARSE_INDEX_MEMORY_ONLY flag
3a2f316 sparse-checkout: clear tracked sparse dirs
fb47b56 sparse-checkout: add config to disable deleting dirs
```

These commits are the ones under review as of gitgitgadget#1009. Recent review made this less stable. It's a slightly different and more robust version of git#396.

> Note: I'm still not done with the feedback for upstream, but the remaining feedback is "can we add tests that cover these tricky technical bits?" and in `microsoft/git` these are already covered by the Scalar functional tests (since that's how they were found).

```
080b02c diff: ignore sparse paths in diffstat
d91a647 merge: make sparse-aware with ORT
df49b5f merge-ort: expand only for out-of-cone conflicts
cdecb85 t1092: add cherry-pick, rebase tests
0c1ecfb sequencer: ensure full index if not ORT strategy
406dfbe sparse-index: integrate with cherry-pick and rebase
```

These commits integrate with `git merge`, `git cherry-pick`, `git revert`, and `git rebase` as of gitgitgadget#1019. This got some feedback that changed how the tests were working so they are more robust. This led to a new commit (0c1ecfb).

```
cbb0ab3 Merge branch 'sparse-index/merge' into vfs-2.33.0
acb8623 t7524: test no longer fails
```

Finally, the commits are merged into `vfs-2.33.0` and also we include a fix to a `microsoft/git` test that is no longer broken.

Cc: @vdye and @ldennington to get a (possibly overwhelming?) taste of sparse-index stuff. If you focus solely on the `git merge` commits you'll get a feel for what a sparse index integration looks like.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Nov 2, 2021
This branch is exactly git#410, but with one more commit: enabling the sparse index by default in d59110a.

Having this in the `vfs-2.33.0` branch helps build confidence that the sparse index is doing what it should be doing by running in the Scalar functional tests and in our test branches.

If we want to cut a new `microsoft/git` release without enabling the sparse index, we can simply revert this commit.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Nov 2, 2021
One thing I forgot when talking about the sparse index is that we have a performance test: `t/perf/p2000-sparse-operations.sh`. This test wasn't helpful for commands like `git merge` that need a particular set of input, but work for more read-only operations.

Here is a quick demonstration of how this performance test works so we could have a definitive measure of how your previous updates improved performance. 

To get these results, I ran the following command in `t/perf`:

```
 ./run 4bcd533 f9255a5 f28fc01 b713582 -- p2000-sparse-operations.sh
```

The short-shas correspond to the merge commits for these PRs:

* git#410 
* git#421 
* git#417 
* git#419

The test takes a copy of the Git repository and creates several copies within a nested directory heirarchy.


```
Test                                                   4bcd533       f9255a5              f28fc01              b713582           
-------------------------------------------------------------------------------------------------------------------------------------------------
2000.2: git status (full-v3)                           0.19(0.15+0.05)   0.19(0.16+0.05) +0.0%    0.20(0.18+0.03) +5.3%    0.19(0.17+0.04) +0.0% 
2000.3: git status (full-v4)                           0.20(0.18+0.04)   0.19(0.15+0.06) -5.0%    0.21(0.18+0.05) +5.0%    0.18(0.18+0.02) -10.0%
2000.4: git status (sparse-v3)                         0.04(0.04+0.04)   0.05(0.07+0.04) +25.0%   0.04(0.04+0.05) +0.0%    0.04(0.06+0.04) +0.0% 
2000.5: git status (sparse-v4)                         0.04(0.03+0.06)   0.04(0.05+0.05) +0.0%    0.05(0.05+0.04) +25.0%   0.05(0.06+0.04) +25.0%
2000.6: git add -A (full-v3)                           0.36(0.29+0.05)   0.38(0.28+0.07) +5.6%    0.36(0.31+0.05) +0.0%    0.37(0.31+0.05) +2.8% 
2000.7: git add -A (full-v4)                           0.34(0.27+0.06)   0.34(0.29+0.05) +0.0%    0.34(0.29+0.04) +0.0%    0.35(0.28+0.06) +2.9% 
2000.8: git add -A (sparse-v3)                         0.06(0.07+0.04)   0.06(0.05+0.06) +0.0%    0.06(0.09+0.01) +0.0%    0.06(0.08+0.03) +0.0% 
2000.9: git add -A (sparse-v4)                         0.05(0.05+0.04)   0.05(0.05+0.07) +0.0%    0.05(0.04+0.06) +0.0%    0.06(0.06+0.05) +20.0%
2000.10: git add . (full-v3)                           0.38(0.31+0.05)   0.37(0.29+0.06) -2.6%    0.37(0.30+0.07) -2.6%    0.37(0.29+0.06) -2.6% 
2000.11: git add . (full-v4)                           0.35(0.31+0.04)   0.35(0.29+0.07) +0.0%    0.35(0.29+0.05) +0.0%    0.34(0.29+0.06) -2.9% 
2000.12: git add . (sparse-v3)                         0.06(0.06+0.05)   0.06(0.05+0.06) +0.0%    0.06(0.07+0.05) +0.0%    0.06(0.09+0.03) +0.0% 
2000.13: git add . (sparse-v4)                         0.06(0.06+0.06)   0.06(0.07+0.04) +0.0%    0.05(0.06+0.05) -16.7%   0.05(0.05+0.07) -16.7%
2000.14: git commit -a -m A (full-v3)                  0.48(0.37+0.08)   0.45(0.36+0.08) -6.2%    0.45(0.35+0.09) -6.2%    0.44(0.36+0.07) -8.3% 
2000.15: git commit -a -m A (full-v4)                  0.45(0.40+0.06)   0.43(0.34+0.07) -4.4%    0.45(0.37+0.06) +0.0%    0.42(0.36+0.05) -6.7% 
2000.16: git commit -a -m A (sparse-v3)                0.05(0.05+0.06)   0.05(0.05+0.03) +0.0%    0.05(0.06+0.06) +0.0%    0.05(0.04+0.06) +0.0% 
2000.17: git commit -a -m A (sparse-v4)                0.05(0.06+0.03)   0.05(0.06+0.04) +0.0%    0.06(0.07+0.05) +20.0%   0.05(0.04+0.06) +0.0% 
2000.18: git checkout -f - (full-v3)                   0.55(0.43+0.08)   0.54(0.46+0.05) -1.8%    0.55(0.46+0.07) +0.0%    0.54(0.40+0.10) -1.8% 
2000.19: git checkout -f - (full-v4)                   0.55(0.41+0.09)   0.50(0.40+0.09) -9.1%    0.51(0.46+0.05) -7.3%    0.51(0.44+0.06) -7.3% 
2000.20: git checkout -f - (sparse-v3)                 0.06(0.09+0.03)   0.06(0.08+0.03) +0.0%    0.06(0.06+0.05) +0.0%    0.07(0.09+0.03) +16.7%
2000.21: git checkout -f - (sparse-v4)                 0.06(0.08+0.04)   0.05(0.07+0.05) -16.7%   0.05(0.07+0.04) -16.7%   0.06(0.09+0.03) +0.0% 
```

All of the above were already integrated.

```
2000.22: git reset (full-v3)                           0.41(0.32+0.06)   0.40(0.31+0.06) -2.4%    0.41(0.33+0.05) +0.0%    0.42(0.34+0.04) +2.4% 
2000.23: git reset (full-v4)                           0.37(0.32+0.05)   0.35(0.30+0.05) -5.4%    0.37(0.30+0.05) +0.0%    0.35(0.31+0.03) -5.4% 
2000.24: git reset (sparse-v3)                         0.68(0.65+0.05)   0.55(0.52+0.04) -19.1%   0.04(0.05+0.04) -94.1%   0.04(0.05+0.04) -94.1%
2000.25: git reset (sparse-v4)                         0.70(0.65+0.05)   0.54(0.50+0.06) -22.9%   0.04(0.07+0.01) -94.3%   0.03(0.05+0.05) -95.7%
2000.26: git reset --hard (full-v3)                    0.54(0.43+0.07)   0.53(0.43+0.06) -1.9%    0.55(0.46+0.05) +1.9%    0.55(0.44+0.06) +1.9% 
2000.27: git reset --hard (full-v4)                    0.50(0.45+0.03)   0.50(0.43+0.05) +0.0%    0.49(0.41+0.06) -2.0%    0.50(0.42+0.05) +0.0% 
2000.28: git reset --hard (sparse-v3)                  0.83(0.76+0.06)   0.68(0.62+0.05) -18.1%   0.07(0.05+0.02) -91.6%   0.07(0.05+0.02) -91.6%
2000.29: git reset --hard (sparse-v4)                  0.80(0.75+0.05)   0.69(0.62+0.06) -13.8%   0.07(0.04+0.02) -91.2%   0.07(0.04+0.03) -91.2%
```

As expected, `git reset [--hard]` improves with the sparse index integration, but remains constant across the full index case.

```
2000.30: git update-index --add --remove (full-v3)     0.03(0.01+0.01)   0.03(0.02+0.01) +0.0%    0.03(0.02+0.01) +0.0%    0.03(0.01+0.01) +0.0% 
2000.31: git update-index --add --remove (full-v4)     0.03(0.02+0.01)   0.03(0.02+0.01) +0.0%    0.03(0.03+0.00) +0.0%    0.03(0.02+0.01) +0.0% 
2000.32: git update-index --add --remove (sparse-v3)   0.57(0.54+0.02)   0.43(0.42+0.00) -24.6%   0.44(0.41+0.03) -22.8%   0.44(0.42+0.01) -22.8%
2000.33: git update-index --add --remove (sparse-v4)   0.56(0.52+0.04)   0.43(0.42+0.01) -23.2%   0.44(0.42+0.02) -21.4%   0.42(0.41+0.01) -25.0%
```

These do not change significantly because git#423 is not merged.

```
2000.34: git diff (full-v3)                            0.07(0.05+0.03)   0.06(0.05+0.03) -14.3%   0.07(0.05+0.03) +0.0%    0.06(0.05+0.03) -14.3%
2000.35: git diff (full-v4)                            0.06(0.05+0.03)   0.06(0.05+0.02) +0.0%    0.06(0.05+0.02) +0.0%    0.06(0.06+0.02) +0.0% 
2000.36: git diff (sparse-v3)                          0.25(0.23+0.03)   0.17(0.17+0.02) -32.0%   0.18(0.18+0.02) -28.0%   0.01(0.03+0.03) -96.0%
2000.37: git diff (sparse-v4)                          0.25(0.22+0.05)   0.16(0.16+0.01) -36.0%   0.18(0.15+0.04) -28.0%   0.01(0.04+0.02) -96.0%
2000.38: git diff --staged (full-v3)                   0.03(0.01+0.01)   0.03(0.02+0.01) +0.0%    0.03(0.02+0.01) +0.0%    0.03(0.02+0.00) +0.0% 
2000.39: git diff --staged (full-v4)                   0.04(0.03+0.01)   0.03(0.02+0.01) -25.0%   0.03(0.03+0.00) -25.0%   0.03(0.03+0.00) -25.0%
2000.40: git diff --staged (sparse-v3)                 0.21(0.19+0.01)   0.15(0.13+0.01) -28.6%   0.15(0.14+0.01) -28.6%   0.01(0.01+0.00) -95.2%
2000.41: git diff --staged (sparse-v4)                 0.22(0.21+0.01)   0.14(0.11+0.03) -36.4%   0.15(0.13+0.02) -31.8%   0.01(0.01+0.00) -95.5%
```

The `git diff` improvements are measurable.

```
2000.42: git sparse-checkout reapply (full-v3)         0.63(0.54+0.05)   0.56(0.48+0.04) -11.1%   0.57(0.48+0.03) -9.5%    0.59(0.48+0.05) -6.3% 
2000.43: git sparse-checkout reapply (full-v4)         0.60(0.54+0.02)   0.51(0.46+0.03) -15.0%   0.54(0.48+0.02) -10.0%   0.50(0.44+0.04) -16.7%
2000.44: git sparse-checkout reapply (sparse-v3)       0.91(0.86+0.05)   0.05(0.05+0.00) -94.5%   0.06(0.05+0.01) -93.4%   0.06(0.06+0.00) -93.4%
2000.45: git sparse-checkout reapply (sparse-v4)       0.92(0.88+0.04)   0.05(0.05+0.00) -94.6%   0.05(0.05+0.01) -94.6%   0.05(0.04+0.01) -94.6%
```

Finally, the `git sparse-checkout` measurements are also present.

This test script is particularly valuable when contributing changes upstream. It can be good to start by adding the lines to the performance test in an early commit, then demonstrating the performance change by copying the necessary lines from the output table into your commit message.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Nov 10, 2021
```
6e74958 p2000: add 'git checkout -' test and decrease depth
3e1d03c p2000: compress repo names
cd94f82 commit: integrate with sparse-index
65e79b8 sparse-index: recompute cache-tree
e9a9981 checkout: stop expanding sparse indexes
4b801c8 t1092: document bad 'git checkout' behavior
71e3015 unpack-trees: resolve sparse-directory/file conflicts
5e96df4 t1092: test merge conflicts outside cone
defab1b add: allow operating on a sparse-only index
9fc4313 pathspec: stop calling ensure_full_index
0ec03ab add: ignore outside the sparse-checkout in refresh()
adf5b15 add: remove ensure_full_index() with --renormalize
```

These commits are equivalent to those already in `next` via gitgitgadget#999.

```
80b8d6c Merge branch 'sparse-index/add' into stolee/sparse-index/add
```

This merge resolves conflicts with some work that happened in parallel, but is already in upstream `master`.

```
c407b2c t7519: rewrite sparse index test
9dad0d2 sparse-index: silently return when not using cone-mode patterns
2974920 sparse-index: silently return when cache tree fails
e7cdaa0 unpack-trees: fix nested sparse-dir search
347410c sparse-checkout: create helper methods
4537233 attr: be careful about sparse directories
5282a86 sparse-index: add SPARSE_INDEX_MEMORY_ONLY flag
3a2f316 sparse-checkout: clear tracked sparse dirs
fb47b56 sparse-checkout: add config to disable deleting dirs
```

These commits are the ones under review as of gitgitgadget#1009. Recent review made this less stable. It's a slightly different and more robust version of git#396.

> Note: I'm still not done with the feedback for upstream, but the remaining feedback is "can we add tests that cover these tricky technical bits?" and in `microsoft/git` these are already covered by the Scalar functional tests (since that's how they were found).

```
080b02c diff: ignore sparse paths in diffstat
d91a647 merge: make sparse-aware with ORT
df49b5f merge-ort: expand only for out-of-cone conflicts
cdecb85 t1092: add cherry-pick, rebase tests
0c1ecfb sequencer: ensure full index if not ORT strategy
406dfbe sparse-index: integrate with cherry-pick and rebase
```

These commits integrate with `git merge`, `git cherry-pick`, `git revert`, and `git rebase` as of gitgitgadget#1019. This got some feedback that changed how the tests were working so they are more robust. This led to a new commit (0c1ecfb).

```
cbb0ab3 Merge branch 'sparse-index/merge' into vfs-2.33.0
acb8623 t7524: test no longer fails
```

Finally, the commits are merged into `vfs-2.33.0` and also we include a fix to a `microsoft/git` test that is no longer broken.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Nov 10, 2021
This branch is exactly git#410, but with one more commit: enabling the sparse index by default in d59110a.

Having this in the `vfs-2.33.0` branch helps build confidence that the sparse index is doing what it should be doing by running in the Scalar functional tests and in our test branches.

If we want to cut a new `microsoft/git` release without enabling the sparse index, we can simply revert this commit.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Nov 10, 2021
One thing I forgot when talking about the sparse index is that we have a performance test: `t/perf/p2000-sparse-operations.sh`. This test wasn't helpful for commands like `git merge` that need a particular set of input, but work for more read-only operations.

Here is a quick demonstration of how this performance test works so we could have a definitive measure of how your previous updates improved performance. 

To get these results, I ran the following command in `t/perf`:

```
 ./run 4bcd533 f9255a5 f28fc01 b713582 -- p2000-sparse-operations.sh
```

The short-shas correspond to the merge commits for these PRs:

* git#410 
* git#421 
* git#417 
* git#419

The test takes a copy of the Git repository and creates several copies within a nested directory heirarchy.


```
Test                                                   4bcd533       f9255a5              f28fc01              b713582           
-------------------------------------------------------------------------------------------------------------------------------------------------
2000.2: git status (full-v3)                           0.19(0.15+0.05)   0.19(0.16+0.05) +0.0%    0.20(0.18+0.03) +5.3%    0.19(0.17+0.04) +0.0% 
2000.3: git status (full-v4)                           0.20(0.18+0.04)   0.19(0.15+0.06) -5.0%    0.21(0.18+0.05) +5.0%    0.18(0.18+0.02) -10.0%
2000.4: git status (sparse-v3)                         0.04(0.04+0.04)   0.05(0.07+0.04) +25.0%   0.04(0.04+0.05) +0.0%    0.04(0.06+0.04) +0.0% 
2000.5: git status (sparse-v4)                         0.04(0.03+0.06)   0.04(0.05+0.05) +0.0%    0.05(0.05+0.04) +25.0%   0.05(0.06+0.04) +25.0%
2000.6: git add -A (full-v3)                           0.36(0.29+0.05)   0.38(0.28+0.07) +5.6%    0.36(0.31+0.05) +0.0%    0.37(0.31+0.05) +2.8% 
2000.7: git add -A (full-v4)                           0.34(0.27+0.06)   0.34(0.29+0.05) +0.0%    0.34(0.29+0.04) +0.0%    0.35(0.28+0.06) +2.9% 
2000.8: git add -A (sparse-v3)                         0.06(0.07+0.04)   0.06(0.05+0.06) +0.0%    0.06(0.09+0.01) +0.0%    0.06(0.08+0.03) +0.0% 
2000.9: git add -A (sparse-v4)                         0.05(0.05+0.04)   0.05(0.05+0.07) +0.0%    0.05(0.04+0.06) +0.0%    0.06(0.06+0.05) +20.0%
2000.10: git add . (full-v3)                           0.38(0.31+0.05)   0.37(0.29+0.06) -2.6%    0.37(0.30+0.07) -2.6%    0.37(0.29+0.06) -2.6% 
2000.11: git add . (full-v4)                           0.35(0.31+0.04)   0.35(0.29+0.07) +0.0%    0.35(0.29+0.05) +0.0%    0.34(0.29+0.06) -2.9% 
2000.12: git add . (sparse-v3)                         0.06(0.06+0.05)   0.06(0.05+0.06) +0.0%    0.06(0.07+0.05) +0.0%    0.06(0.09+0.03) +0.0% 
2000.13: git add . (sparse-v4)                         0.06(0.06+0.06)   0.06(0.07+0.04) +0.0%    0.05(0.06+0.05) -16.7%   0.05(0.05+0.07) -16.7%
2000.14: git commit -a -m A (full-v3)                  0.48(0.37+0.08)   0.45(0.36+0.08) -6.2%    0.45(0.35+0.09) -6.2%    0.44(0.36+0.07) -8.3% 
2000.15: git commit -a -m A (full-v4)                  0.45(0.40+0.06)   0.43(0.34+0.07) -4.4%    0.45(0.37+0.06) +0.0%    0.42(0.36+0.05) -6.7% 
2000.16: git commit -a -m A (sparse-v3)                0.05(0.05+0.06)   0.05(0.05+0.03) +0.0%    0.05(0.06+0.06) +0.0%    0.05(0.04+0.06) +0.0% 
2000.17: git commit -a -m A (sparse-v4)                0.05(0.06+0.03)   0.05(0.06+0.04) +0.0%    0.06(0.07+0.05) +20.0%   0.05(0.04+0.06) +0.0% 
2000.18: git checkout -f - (full-v3)                   0.55(0.43+0.08)   0.54(0.46+0.05) -1.8%    0.55(0.46+0.07) +0.0%    0.54(0.40+0.10) -1.8% 
2000.19: git checkout -f - (full-v4)                   0.55(0.41+0.09)   0.50(0.40+0.09) -9.1%    0.51(0.46+0.05) -7.3%    0.51(0.44+0.06) -7.3% 
2000.20: git checkout -f - (sparse-v3)                 0.06(0.09+0.03)   0.06(0.08+0.03) +0.0%    0.06(0.06+0.05) +0.0%    0.07(0.09+0.03) +16.7%
2000.21: git checkout -f - (sparse-v4)                 0.06(0.08+0.04)   0.05(0.07+0.05) -16.7%   0.05(0.07+0.04) -16.7%   0.06(0.09+0.03) +0.0% 
```

All of the above were already integrated.

```
2000.22: git reset (full-v3)                           0.41(0.32+0.06)   0.40(0.31+0.06) -2.4%    0.41(0.33+0.05) +0.0%    0.42(0.34+0.04) +2.4% 
2000.23: git reset (full-v4)                           0.37(0.32+0.05)   0.35(0.30+0.05) -5.4%    0.37(0.30+0.05) +0.0%    0.35(0.31+0.03) -5.4% 
2000.24: git reset (sparse-v3)                         0.68(0.65+0.05)   0.55(0.52+0.04) -19.1%   0.04(0.05+0.04) -94.1%   0.04(0.05+0.04) -94.1%
2000.25: git reset (sparse-v4)                         0.70(0.65+0.05)   0.54(0.50+0.06) -22.9%   0.04(0.07+0.01) -94.3%   0.03(0.05+0.05) -95.7%
2000.26: git reset --hard (full-v3)                    0.54(0.43+0.07)   0.53(0.43+0.06) -1.9%    0.55(0.46+0.05) +1.9%    0.55(0.44+0.06) +1.9% 
2000.27: git reset --hard (full-v4)                    0.50(0.45+0.03)   0.50(0.43+0.05) +0.0%    0.49(0.41+0.06) -2.0%    0.50(0.42+0.05) +0.0% 
2000.28: git reset --hard (sparse-v3)                  0.83(0.76+0.06)   0.68(0.62+0.05) -18.1%   0.07(0.05+0.02) -91.6%   0.07(0.05+0.02) -91.6%
2000.29: git reset --hard (sparse-v4)                  0.80(0.75+0.05)   0.69(0.62+0.06) -13.8%   0.07(0.04+0.02) -91.2%   0.07(0.04+0.03) -91.2%
```

As expected, `git reset [--hard]` improves with the sparse index integration, but remains constant across the full index case.

```
2000.30: git update-index --add --remove (full-v3)     0.03(0.01+0.01)   0.03(0.02+0.01) +0.0%    0.03(0.02+0.01) +0.0%    0.03(0.01+0.01) +0.0% 
2000.31: git update-index --add --remove (full-v4)     0.03(0.02+0.01)   0.03(0.02+0.01) +0.0%    0.03(0.03+0.00) +0.0%    0.03(0.02+0.01) +0.0% 
2000.32: git update-index --add --remove (sparse-v3)   0.57(0.54+0.02)   0.43(0.42+0.00) -24.6%   0.44(0.41+0.03) -22.8%   0.44(0.42+0.01) -22.8%
2000.33: git update-index --add --remove (sparse-v4)   0.56(0.52+0.04)   0.43(0.42+0.01) -23.2%   0.44(0.42+0.02) -21.4%   0.42(0.41+0.01) -25.0%
```

These do not change significantly because git#423 is not merged.

```
2000.34: git diff (full-v3)                            0.07(0.05+0.03)   0.06(0.05+0.03) -14.3%   0.07(0.05+0.03) +0.0%    0.06(0.05+0.03) -14.3%
2000.35: git diff (full-v4)                            0.06(0.05+0.03)   0.06(0.05+0.02) +0.0%    0.06(0.05+0.02) +0.0%    0.06(0.06+0.02) +0.0% 
2000.36: git diff (sparse-v3)                          0.25(0.23+0.03)   0.17(0.17+0.02) -32.0%   0.18(0.18+0.02) -28.0%   0.01(0.03+0.03) -96.0%
2000.37: git diff (sparse-v4)                          0.25(0.22+0.05)   0.16(0.16+0.01) -36.0%   0.18(0.15+0.04) -28.0%   0.01(0.04+0.02) -96.0%
2000.38: git diff --staged (full-v3)                   0.03(0.01+0.01)   0.03(0.02+0.01) +0.0%    0.03(0.02+0.01) +0.0%    0.03(0.02+0.00) +0.0% 
2000.39: git diff --staged (full-v4)                   0.04(0.03+0.01)   0.03(0.02+0.01) -25.0%   0.03(0.03+0.00) -25.0%   0.03(0.03+0.00) -25.0%
2000.40: git diff --staged (sparse-v3)                 0.21(0.19+0.01)   0.15(0.13+0.01) -28.6%   0.15(0.14+0.01) -28.6%   0.01(0.01+0.00) -95.2%
2000.41: git diff --staged (sparse-v4)                 0.22(0.21+0.01)   0.14(0.11+0.03) -36.4%   0.15(0.13+0.02) -31.8%   0.01(0.01+0.00) -95.5%
```

The `git diff` improvements are measurable.

```
2000.42: git sparse-checkout reapply (full-v3)         0.63(0.54+0.05)   0.56(0.48+0.04) -11.1%   0.57(0.48+0.03) -9.5%    0.59(0.48+0.05) -6.3% 
2000.43: git sparse-checkout reapply (full-v4)         0.60(0.54+0.02)   0.51(0.46+0.03) -15.0%   0.54(0.48+0.02) -10.0%   0.50(0.44+0.04) -16.7%
2000.44: git sparse-checkout reapply (sparse-v3)       0.91(0.86+0.05)   0.05(0.05+0.00) -94.5%   0.06(0.05+0.01) -93.4%   0.06(0.06+0.00) -93.4%
2000.45: git sparse-checkout reapply (sparse-v4)       0.92(0.88+0.04)   0.05(0.05+0.00) -94.6%   0.05(0.05+0.01) -94.6%   0.05(0.04+0.01) -94.6%
```

Finally, the `git sparse-checkout` measurements are also present.

This test script is particularly valuable when contributing changes upstream. It can be good to start by adding the lines to the performance test in an early commit, then demonstrating the performance change by copying the necessary lines from the output table into your commit message.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Nov 16, 2021
```
6e74958 p2000: add 'git checkout -' test and decrease depth
3e1d03c p2000: compress repo names
cd94f82 commit: integrate with sparse-index
65e79b8 sparse-index: recompute cache-tree
e9a9981 checkout: stop expanding sparse indexes
4b801c8 t1092: document bad 'git checkout' behavior
71e3015 unpack-trees: resolve sparse-directory/file conflicts
5e96df4 t1092: test merge conflicts outside cone
defab1b add: allow operating on a sparse-only index
9fc4313 pathspec: stop calling ensure_full_index
0ec03ab add: ignore outside the sparse-checkout in refresh()
adf5b15 add: remove ensure_full_index() with --renormalize
```

These commits are equivalent to those already in `next` via gitgitgadget#999.

```
80b8d6c Merge branch 'sparse-index/add' into stolee/sparse-index/add
```

This merge resolves conflicts with some work that happened in parallel, but is already in upstream `master`.

```
c407b2c t7519: rewrite sparse index test
9dad0d2 sparse-index: silently return when not using cone-mode patterns
2974920 sparse-index: silently return when cache tree fails
e7cdaa0 unpack-trees: fix nested sparse-dir search
347410c sparse-checkout: create helper methods
4537233 attr: be careful about sparse directories
5282a86 sparse-index: add SPARSE_INDEX_MEMORY_ONLY flag
3a2f316 sparse-checkout: clear tracked sparse dirs
fb47b56 sparse-checkout: add config to disable deleting dirs
```

These commits are the ones under review as of gitgitgadget#1009. Recent review made this less stable. It's a slightly different and more robust version of git#396.

> Note: I'm still not done with the feedback for upstream, but the remaining feedback is "can we add tests that cover these tricky technical bits?" and in `microsoft/git` these are already covered by the Scalar functional tests (since that's how they were found).

```
080b02c diff: ignore sparse paths in diffstat
d91a647 merge: make sparse-aware with ORT
df49b5f merge-ort: expand only for out-of-cone conflicts
cdecb85 t1092: add cherry-pick, rebase tests
0c1ecfb sequencer: ensure full index if not ORT strategy
406dfbe sparse-index: integrate with cherry-pick and rebase
```

These commits integrate with `git merge`, `git cherry-pick`, `git revert`, and `git rebase` as of gitgitgadget#1019. This got some feedback that changed how the tests were working so they are more robust. This led to a new commit (0c1ecfb).

```
cbb0ab3 Merge branch 'sparse-index/merge' into vfs-2.33.0
acb8623 t7524: test no longer fails
```

Finally, the commits are merged into `vfs-2.33.0` and also we include a fix to a `microsoft/git` test that is no longer broken.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Nov 16, 2021
This branch is exactly git#410, but with one more commit: enabling the sparse index by default in d59110a.

Having this in the `vfs-2.33.0` branch helps build confidence that the sparse index is doing what it should be doing by running in the Scalar functional tests and in our test branches.

If we want to cut a new `microsoft/git` release without enabling the sparse index, we can simply revert this commit.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Nov 16, 2021
One thing I forgot when talking about the sparse index is that we have a performance test: `t/perf/p2000-sparse-operations.sh`. This test wasn't helpful for commands like `git merge` that need a particular set of input, but work for more read-only operations.

Here is a quick demonstration of how this performance test works so we could have a definitive measure of how your previous updates improved performance. 

To get these results, I ran the following command in `t/perf`:

```
 ./run 4bcd533 f9255a5 f28fc01 b713582 -- p2000-sparse-operations.sh
```

The short-shas correspond to the merge commits for these PRs:

* git#410 
* git#421 
* git#417 
* git#419

The test takes a copy of the Git repository and creates several copies within a nested directory heirarchy.


```
Test                                                   4bcd533       f9255a5              f28fc01              b713582           
-------------------------------------------------------------------------------------------------------------------------------------------------
2000.2: git status (full-v3)                           0.19(0.15+0.05)   0.19(0.16+0.05) +0.0%    0.20(0.18+0.03) +5.3%    0.19(0.17+0.04) +0.0% 
2000.3: git status (full-v4)                           0.20(0.18+0.04)   0.19(0.15+0.06) -5.0%    0.21(0.18+0.05) +5.0%    0.18(0.18+0.02) -10.0%
2000.4: git status (sparse-v3)                         0.04(0.04+0.04)   0.05(0.07+0.04) +25.0%   0.04(0.04+0.05) +0.0%    0.04(0.06+0.04) +0.0% 
2000.5: git status (sparse-v4)                         0.04(0.03+0.06)   0.04(0.05+0.05) +0.0%    0.05(0.05+0.04) +25.0%   0.05(0.06+0.04) +25.0%
2000.6: git add -A (full-v3)                           0.36(0.29+0.05)   0.38(0.28+0.07) +5.6%    0.36(0.31+0.05) +0.0%    0.37(0.31+0.05) +2.8% 
2000.7: git add -A (full-v4)                           0.34(0.27+0.06)   0.34(0.29+0.05) +0.0%    0.34(0.29+0.04) +0.0%    0.35(0.28+0.06) +2.9% 
2000.8: git add -A (sparse-v3)                         0.06(0.07+0.04)   0.06(0.05+0.06) +0.0%    0.06(0.09+0.01) +0.0%    0.06(0.08+0.03) +0.0% 
2000.9: git add -A (sparse-v4)                         0.05(0.05+0.04)   0.05(0.05+0.07) +0.0%    0.05(0.04+0.06) +0.0%    0.06(0.06+0.05) +20.0%
2000.10: git add . (full-v3)                           0.38(0.31+0.05)   0.37(0.29+0.06) -2.6%    0.37(0.30+0.07) -2.6%    0.37(0.29+0.06) -2.6% 
2000.11: git add . (full-v4)                           0.35(0.31+0.04)   0.35(0.29+0.07) +0.0%    0.35(0.29+0.05) +0.0%    0.34(0.29+0.06) -2.9% 
2000.12: git add . (sparse-v3)                         0.06(0.06+0.05)   0.06(0.05+0.06) +0.0%    0.06(0.07+0.05) +0.0%    0.06(0.09+0.03) +0.0% 
2000.13: git add . (sparse-v4)                         0.06(0.06+0.06)   0.06(0.07+0.04) +0.0%    0.05(0.06+0.05) -16.7%   0.05(0.05+0.07) -16.7%
2000.14: git commit -a -m A (full-v3)                  0.48(0.37+0.08)   0.45(0.36+0.08) -6.2%    0.45(0.35+0.09) -6.2%    0.44(0.36+0.07) -8.3% 
2000.15: git commit -a -m A (full-v4)                  0.45(0.40+0.06)   0.43(0.34+0.07) -4.4%    0.45(0.37+0.06) +0.0%    0.42(0.36+0.05) -6.7% 
2000.16: git commit -a -m A (sparse-v3)                0.05(0.05+0.06)   0.05(0.05+0.03) +0.0%    0.05(0.06+0.06) +0.0%    0.05(0.04+0.06) +0.0% 
2000.17: git commit -a -m A (sparse-v4)                0.05(0.06+0.03)   0.05(0.06+0.04) +0.0%    0.06(0.07+0.05) +20.0%   0.05(0.04+0.06) +0.0% 
2000.18: git checkout -f - (full-v3)                   0.55(0.43+0.08)   0.54(0.46+0.05) -1.8%    0.55(0.46+0.07) +0.0%    0.54(0.40+0.10) -1.8% 
2000.19: git checkout -f - (full-v4)                   0.55(0.41+0.09)   0.50(0.40+0.09) -9.1%    0.51(0.46+0.05) -7.3%    0.51(0.44+0.06) -7.3% 
2000.20: git checkout -f - (sparse-v3)                 0.06(0.09+0.03)   0.06(0.08+0.03) +0.0%    0.06(0.06+0.05) +0.0%    0.07(0.09+0.03) +16.7%
2000.21: git checkout -f - (sparse-v4)                 0.06(0.08+0.04)   0.05(0.07+0.05) -16.7%   0.05(0.07+0.04) -16.7%   0.06(0.09+0.03) +0.0% 
```

All of the above were already integrated.

```
2000.22: git reset (full-v3)                           0.41(0.32+0.06)   0.40(0.31+0.06) -2.4%    0.41(0.33+0.05) +0.0%    0.42(0.34+0.04) +2.4% 
2000.23: git reset (full-v4)                           0.37(0.32+0.05)   0.35(0.30+0.05) -5.4%    0.37(0.30+0.05) +0.0%    0.35(0.31+0.03) -5.4% 
2000.24: git reset (sparse-v3)                         0.68(0.65+0.05)   0.55(0.52+0.04) -19.1%   0.04(0.05+0.04) -94.1%   0.04(0.05+0.04) -94.1%
2000.25: git reset (sparse-v4)                         0.70(0.65+0.05)   0.54(0.50+0.06) -22.9%   0.04(0.07+0.01) -94.3%   0.03(0.05+0.05) -95.7%
2000.26: git reset --hard (full-v3)                    0.54(0.43+0.07)   0.53(0.43+0.06) -1.9%    0.55(0.46+0.05) +1.9%    0.55(0.44+0.06) +1.9% 
2000.27: git reset --hard (full-v4)                    0.50(0.45+0.03)   0.50(0.43+0.05) +0.0%    0.49(0.41+0.06) -2.0%    0.50(0.42+0.05) +0.0% 
2000.28: git reset --hard (sparse-v3)                  0.83(0.76+0.06)   0.68(0.62+0.05) -18.1%   0.07(0.05+0.02) -91.6%   0.07(0.05+0.02) -91.6%
2000.29: git reset --hard (sparse-v4)                  0.80(0.75+0.05)   0.69(0.62+0.06) -13.8%   0.07(0.04+0.02) -91.2%   0.07(0.04+0.03) -91.2%
```

As expected, `git reset [--hard]` improves with the sparse index integration, but remains constant across the full index case.

```
2000.30: git update-index --add --remove (full-v3)     0.03(0.01+0.01)   0.03(0.02+0.01) +0.0%    0.03(0.02+0.01) +0.0%    0.03(0.01+0.01) +0.0% 
2000.31: git update-index --add --remove (full-v4)     0.03(0.02+0.01)   0.03(0.02+0.01) +0.0%    0.03(0.03+0.00) +0.0%    0.03(0.02+0.01) +0.0% 
2000.32: git update-index --add --remove (sparse-v3)   0.57(0.54+0.02)   0.43(0.42+0.00) -24.6%   0.44(0.41+0.03) -22.8%   0.44(0.42+0.01) -22.8%
2000.33: git update-index --add --remove (sparse-v4)   0.56(0.52+0.04)   0.43(0.42+0.01) -23.2%   0.44(0.42+0.02) -21.4%   0.42(0.41+0.01) -25.0%
```

These do not change significantly because git#423 is not merged.

```
2000.34: git diff (full-v3)                            0.07(0.05+0.03)   0.06(0.05+0.03) -14.3%   0.07(0.05+0.03) +0.0%    0.06(0.05+0.03) -14.3%
2000.35: git diff (full-v4)                            0.06(0.05+0.03)   0.06(0.05+0.02) +0.0%    0.06(0.05+0.02) +0.0%    0.06(0.06+0.02) +0.0% 
2000.36: git diff (sparse-v3)                          0.25(0.23+0.03)   0.17(0.17+0.02) -32.0%   0.18(0.18+0.02) -28.0%   0.01(0.03+0.03) -96.0%
2000.37: git diff (sparse-v4)                          0.25(0.22+0.05)   0.16(0.16+0.01) -36.0%   0.18(0.15+0.04) -28.0%   0.01(0.04+0.02) -96.0%
2000.38: git diff --staged (full-v3)                   0.03(0.01+0.01)   0.03(0.02+0.01) +0.0%    0.03(0.02+0.01) +0.0%    0.03(0.02+0.00) +0.0% 
2000.39: git diff --staged (full-v4)                   0.04(0.03+0.01)   0.03(0.02+0.01) -25.0%   0.03(0.03+0.00) -25.0%   0.03(0.03+0.00) -25.0%
2000.40: git diff --staged (sparse-v3)                 0.21(0.19+0.01)   0.15(0.13+0.01) -28.6%   0.15(0.14+0.01) -28.6%   0.01(0.01+0.00) -95.2%
2000.41: git diff --staged (sparse-v4)                 0.22(0.21+0.01)   0.14(0.11+0.03) -36.4%   0.15(0.13+0.02) -31.8%   0.01(0.01+0.00) -95.5%
```

The `git diff` improvements are measurable.

```
2000.42: git sparse-checkout reapply (full-v3)         0.63(0.54+0.05)   0.56(0.48+0.04) -11.1%   0.57(0.48+0.03) -9.5%    0.59(0.48+0.05) -6.3% 
2000.43: git sparse-checkout reapply (full-v4)         0.60(0.54+0.02)   0.51(0.46+0.03) -15.0%   0.54(0.48+0.02) -10.0%   0.50(0.44+0.04) -16.7%
2000.44: git sparse-checkout reapply (sparse-v3)       0.91(0.86+0.05)   0.05(0.05+0.00) -94.5%   0.06(0.05+0.01) -93.4%   0.06(0.06+0.00) -93.4%
2000.45: git sparse-checkout reapply (sparse-v4)       0.92(0.88+0.04)   0.05(0.05+0.00) -94.6%   0.05(0.05+0.01) -94.6%   0.05(0.04+0.01) -94.6%
```

Finally, the `git sparse-checkout` measurements are also present.

This test script is particularly valuable when contributing changes upstream. It can be good to start by adding the lines to the performance test in an early commit, then demonstrating the performance change by copying the necessary lines from the output table into your commit message.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Jan 18, 2022
```
6e74958 p2000: add 'git checkout -' test and decrease depth
3e1d03c p2000: compress repo names
cd94f82 commit: integrate with sparse-index
65e79b8 sparse-index: recompute cache-tree
e9a9981 checkout: stop expanding sparse indexes
4b801c8 t1092: document bad 'git checkout' behavior
71e3015 unpack-trees: resolve sparse-directory/file conflicts
5e96df4 t1092: test merge conflicts outside cone
defab1b add: allow operating on a sparse-only index
9fc4313 pathspec: stop calling ensure_full_index
0ec03ab add: ignore outside the sparse-checkout in refresh()
adf5b15 add: remove ensure_full_index() with --renormalize
```

These commits are equivalent to those already in `next` via gitgitgadget#999.

```
80b8d6c Merge branch 'sparse-index/add' into stolee/sparse-index/add
```

This merge resolves conflicts with some work that happened in parallel, but is already in upstream `master`.

```
c407b2c t7519: rewrite sparse index test
9dad0d2 sparse-index: silently return when not using cone-mode patterns
2974920 sparse-index: silently return when cache tree fails
e7cdaa0 unpack-trees: fix nested sparse-dir search
347410c sparse-checkout: create helper methods
4537233 attr: be careful about sparse directories
5282a86 sparse-index: add SPARSE_INDEX_MEMORY_ONLY flag
3a2f316 sparse-checkout: clear tracked sparse dirs
fb47b56 sparse-checkout: add config to disable deleting dirs
```

These commits are the ones under review as of gitgitgadget#1009. Recent review made this less stable. It's a slightly different and more robust version of git#396.

> Note: I'm still not done with the feedback for upstream, but the remaining feedback is "can we add tests that cover these tricky technical bits?" and in `microsoft/git` these are already covered by the Scalar functional tests (since that's how they were found).

```
080b02c diff: ignore sparse paths in diffstat
d91a647 merge: make sparse-aware with ORT
df49b5f merge-ort: expand only for out-of-cone conflicts
cdecb85 t1092: add cherry-pick, rebase tests
0c1ecfb sequencer: ensure full index if not ORT strategy
406dfbe sparse-index: integrate with cherry-pick and rebase
```

These commits integrate with `git merge`, `git cherry-pick`, `git revert`, and `git rebase` as of gitgitgadget#1019. This got some feedback that changed how the tests were working so they are more robust. This led to a new commit (0c1ecfb).

```
cbb0ab3 Merge branch 'sparse-index/merge' into vfs-2.33.0
acb8623 t7524: test no longer fails
```

Finally, the commits are merged into `vfs-2.33.0` and also we include a fix to a `microsoft/git` test that is no longer broken.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Jan 18, 2022
This branch is exactly git#410, but with one more commit: enabling the sparse index by default in d59110a.

Having this in the `vfs-2.33.0` branch helps build confidence that the sparse index is doing what it should be doing by running in the Scalar functional tests and in our test branches.

If we want to cut a new `microsoft/git` release without enabling the sparse index, we can simply revert this commit.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Jan 18, 2022
One thing I forgot when talking about the sparse index is that we have a performance test: `t/perf/p2000-sparse-operations.sh`. This test wasn't helpful for commands like `git merge` that need a particular set of input, but work for more read-only operations.

Here is a quick demonstration of how this performance test works so we could have a definitive measure of how your previous updates improved performance. 

To get these results, I ran the following command in `t/perf`:

```
 ./run 4bcd533 f9255a5 f28fc01 b713582 -- p2000-sparse-operations.sh
```

The short-shas correspond to the merge commits for these PRs:

* git#410 
* git#421 
* git#417 
* git#419

The test takes a copy of the Git repository and creates several copies within a nested directory heirarchy.


```
Test                                                   4bcd533       f9255a5              f28fc01              b713582           
-------------------------------------------------------------------------------------------------------------------------------------------------
2000.2: git status (full-v3)                           0.19(0.15+0.05)   0.19(0.16+0.05) +0.0%    0.20(0.18+0.03) +5.3%    0.19(0.17+0.04) +0.0% 
2000.3: git status (full-v4)                           0.20(0.18+0.04)   0.19(0.15+0.06) -5.0%    0.21(0.18+0.05) +5.0%    0.18(0.18+0.02) -10.0%
2000.4: git status (sparse-v3)                         0.04(0.04+0.04)   0.05(0.07+0.04) +25.0%   0.04(0.04+0.05) +0.0%    0.04(0.06+0.04) +0.0% 
2000.5: git status (sparse-v4)                         0.04(0.03+0.06)   0.04(0.05+0.05) +0.0%    0.05(0.05+0.04) +25.0%   0.05(0.06+0.04) +25.0%
2000.6: git add -A (full-v3)                           0.36(0.29+0.05)   0.38(0.28+0.07) +5.6%    0.36(0.31+0.05) +0.0%    0.37(0.31+0.05) +2.8% 
2000.7: git add -A (full-v4)                           0.34(0.27+0.06)   0.34(0.29+0.05) +0.0%    0.34(0.29+0.04) +0.0%    0.35(0.28+0.06) +2.9% 
2000.8: git add -A (sparse-v3)                         0.06(0.07+0.04)   0.06(0.05+0.06) +0.0%    0.06(0.09+0.01) +0.0%    0.06(0.08+0.03) +0.0% 
2000.9: git add -A (sparse-v4)                         0.05(0.05+0.04)   0.05(0.05+0.07) +0.0%    0.05(0.04+0.06) +0.0%    0.06(0.06+0.05) +20.0%
2000.10: git add . (full-v3)                           0.38(0.31+0.05)   0.37(0.29+0.06) -2.6%    0.37(0.30+0.07) -2.6%    0.37(0.29+0.06) -2.6% 
2000.11: git add . (full-v4)                           0.35(0.31+0.04)   0.35(0.29+0.07) +0.0%    0.35(0.29+0.05) +0.0%    0.34(0.29+0.06) -2.9% 
2000.12: git add . (sparse-v3)                         0.06(0.06+0.05)   0.06(0.05+0.06) +0.0%    0.06(0.07+0.05) +0.0%    0.06(0.09+0.03) +0.0% 
2000.13: git add . (sparse-v4)                         0.06(0.06+0.06)   0.06(0.07+0.04) +0.0%    0.05(0.06+0.05) -16.7%   0.05(0.05+0.07) -16.7%
2000.14: git commit -a -m A (full-v3)                  0.48(0.37+0.08)   0.45(0.36+0.08) -6.2%    0.45(0.35+0.09) -6.2%    0.44(0.36+0.07) -8.3% 
2000.15: git commit -a -m A (full-v4)                  0.45(0.40+0.06)   0.43(0.34+0.07) -4.4%    0.45(0.37+0.06) +0.0%    0.42(0.36+0.05) -6.7% 
2000.16: git commit -a -m A (sparse-v3)                0.05(0.05+0.06)   0.05(0.05+0.03) +0.0%    0.05(0.06+0.06) +0.0%    0.05(0.04+0.06) +0.0% 
2000.17: git commit -a -m A (sparse-v4)                0.05(0.06+0.03)   0.05(0.06+0.04) +0.0%    0.06(0.07+0.05) +20.0%   0.05(0.04+0.06) +0.0% 
2000.18: git checkout -f - (full-v3)                   0.55(0.43+0.08)   0.54(0.46+0.05) -1.8%    0.55(0.46+0.07) +0.0%    0.54(0.40+0.10) -1.8% 
2000.19: git checkout -f - (full-v4)                   0.55(0.41+0.09)   0.50(0.40+0.09) -9.1%    0.51(0.46+0.05) -7.3%    0.51(0.44+0.06) -7.3% 
2000.20: git checkout -f - (sparse-v3)                 0.06(0.09+0.03)   0.06(0.08+0.03) +0.0%    0.06(0.06+0.05) +0.0%    0.07(0.09+0.03) +16.7%
2000.21: git checkout -f - (sparse-v4)                 0.06(0.08+0.04)   0.05(0.07+0.05) -16.7%   0.05(0.07+0.04) -16.7%   0.06(0.09+0.03) +0.0% 
```

All of the above were already integrated.

```
2000.22: git reset (full-v3)                           0.41(0.32+0.06)   0.40(0.31+0.06) -2.4%    0.41(0.33+0.05) +0.0%    0.42(0.34+0.04) +2.4% 
2000.23: git reset (full-v4)                           0.37(0.32+0.05)   0.35(0.30+0.05) -5.4%    0.37(0.30+0.05) +0.0%    0.35(0.31+0.03) -5.4% 
2000.24: git reset (sparse-v3)                         0.68(0.65+0.05)   0.55(0.52+0.04) -19.1%   0.04(0.05+0.04) -94.1%   0.04(0.05+0.04) -94.1%
2000.25: git reset (sparse-v4)                         0.70(0.65+0.05)   0.54(0.50+0.06) -22.9%   0.04(0.07+0.01) -94.3%   0.03(0.05+0.05) -95.7%
2000.26: git reset --hard (full-v3)                    0.54(0.43+0.07)   0.53(0.43+0.06) -1.9%    0.55(0.46+0.05) +1.9%    0.55(0.44+0.06) +1.9% 
2000.27: git reset --hard (full-v4)                    0.50(0.45+0.03)   0.50(0.43+0.05) +0.0%    0.49(0.41+0.06) -2.0%    0.50(0.42+0.05) +0.0% 
2000.28: git reset --hard (sparse-v3)                  0.83(0.76+0.06)   0.68(0.62+0.05) -18.1%   0.07(0.05+0.02) -91.6%   0.07(0.05+0.02) -91.6%
2000.29: git reset --hard (sparse-v4)                  0.80(0.75+0.05)   0.69(0.62+0.06) -13.8%   0.07(0.04+0.02) -91.2%   0.07(0.04+0.03) -91.2%
```

As expected, `git reset [--hard]` improves with the sparse index integration, but remains constant across the full index case.

```
2000.30: git update-index --add --remove (full-v3)     0.03(0.01+0.01)   0.03(0.02+0.01) +0.0%    0.03(0.02+0.01) +0.0%    0.03(0.01+0.01) +0.0% 
2000.31: git update-index --add --remove (full-v4)     0.03(0.02+0.01)   0.03(0.02+0.01) +0.0%    0.03(0.03+0.00) +0.0%    0.03(0.02+0.01) +0.0% 
2000.32: git update-index --add --remove (sparse-v3)   0.57(0.54+0.02)   0.43(0.42+0.00) -24.6%   0.44(0.41+0.03) -22.8%   0.44(0.42+0.01) -22.8%
2000.33: git update-index --add --remove (sparse-v4)   0.56(0.52+0.04)   0.43(0.42+0.01) -23.2%   0.44(0.42+0.02) -21.4%   0.42(0.41+0.01) -25.0%
```

These do not change significantly because git#423 is not merged.

```
2000.34: git diff (full-v3)                            0.07(0.05+0.03)   0.06(0.05+0.03) -14.3%   0.07(0.05+0.03) +0.0%    0.06(0.05+0.03) -14.3%
2000.35: git diff (full-v4)                            0.06(0.05+0.03)   0.06(0.05+0.02) +0.0%    0.06(0.05+0.02) +0.0%    0.06(0.06+0.02) +0.0% 
2000.36: git diff (sparse-v3)                          0.25(0.23+0.03)   0.17(0.17+0.02) -32.0%   0.18(0.18+0.02) -28.0%   0.01(0.03+0.03) -96.0%
2000.37: git diff (sparse-v4)                          0.25(0.22+0.05)   0.16(0.16+0.01) -36.0%   0.18(0.15+0.04) -28.0%   0.01(0.04+0.02) -96.0%
2000.38: git diff --staged (full-v3)                   0.03(0.01+0.01)   0.03(0.02+0.01) +0.0%    0.03(0.02+0.01) +0.0%    0.03(0.02+0.00) +0.0% 
2000.39: git diff --staged (full-v4)                   0.04(0.03+0.01)   0.03(0.02+0.01) -25.0%   0.03(0.03+0.00) -25.0%   0.03(0.03+0.00) -25.0%
2000.40: git diff --staged (sparse-v3)                 0.21(0.19+0.01)   0.15(0.13+0.01) -28.6%   0.15(0.14+0.01) -28.6%   0.01(0.01+0.00) -95.2%
2000.41: git diff --staged (sparse-v4)                 0.22(0.21+0.01)   0.14(0.11+0.03) -36.4%   0.15(0.13+0.02) -31.8%   0.01(0.01+0.00) -95.5%
```

The `git diff` improvements are measurable.

```
2000.42: git sparse-checkout reapply (full-v3)         0.63(0.54+0.05)   0.56(0.48+0.04) -11.1%   0.57(0.48+0.03) -9.5%    0.59(0.48+0.05) -6.3% 
2000.43: git sparse-checkout reapply (full-v4)         0.60(0.54+0.02)   0.51(0.46+0.03) -15.0%   0.54(0.48+0.02) -10.0%   0.50(0.44+0.04) -16.7%
2000.44: git sparse-checkout reapply (sparse-v3)       0.91(0.86+0.05)   0.05(0.05+0.00) -94.5%   0.06(0.05+0.01) -93.4%   0.06(0.06+0.00) -93.4%
2000.45: git sparse-checkout reapply (sparse-v4)       0.92(0.88+0.04)   0.05(0.05+0.00) -94.6%   0.05(0.05+0.01) -94.6%   0.05(0.04+0.01) -94.6%
```

Finally, the `git sparse-checkout` measurements are also present.

This test script is particularly valuable when contributing changes upstream. It can be good to start by adding the lines to the performance test in an early commit, then demonstrating the performance change by copying the necessary lines from the output table into your commit message.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Jan 28, 2022
```
6e74958 p2000: add 'git checkout -' test and decrease depth
3e1d03c p2000: compress repo names
cd94f82 commit: integrate with sparse-index
65e79b8 sparse-index: recompute cache-tree
e9a9981 checkout: stop expanding sparse indexes
4b801c8 t1092: document bad 'git checkout' behavior
71e3015 unpack-trees: resolve sparse-directory/file conflicts
5e96df4 t1092: test merge conflicts outside cone
defab1b add: allow operating on a sparse-only index
9fc4313 pathspec: stop calling ensure_full_index
0ec03ab add: ignore outside the sparse-checkout in refresh()
adf5b15 add: remove ensure_full_index() with --renormalize
```

These commits are equivalent to those already in `next` via gitgitgadget#999.

```
80b8d6c Merge branch 'sparse-index/add' into stolee/sparse-index/add
```

This merge resolves conflicts with some work that happened in parallel, but is already in upstream `master`.

```
c407b2c t7519: rewrite sparse index test
9dad0d2 sparse-index: silently return when not using cone-mode patterns
2974920 sparse-index: silently return when cache tree fails
e7cdaa0 unpack-trees: fix nested sparse-dir search
347410c sparse-checkout: create helper methods
4537233 attr: be careful about sparse directories
5282a86 sparse-index: add SPARSE_INDEX_MEMORY_ONLY flag
3a2f316 sparse-checkout: clear tracked sparse dirs
fb47b56 sparse-checkout: add config to disable deleting dirs
```

These commits are the ones under review as of gitgitgadget#1009. Recent review made this less stable. It's a slightly different and more robust version of git#396.

> Note: I'm still not done with the feedback for upstream, but the remaining feedback is "can we add tests that cover these tricky technical bits?" and in `microsoft/git` these are already covered by the Scalar functional tests (since that's how they were found).

```
080b02c diff: ignore sparse paths in diffstat
d91a647 merge: make sparse-aware with ORT
df49b5f merge-ort: expand only for out-of-cone conflicts
cdecb85 t1092: add cherry-pick, rebase tests
0c1ecfb sequencer: ensure full index if not ORT strategy
406dfbe sparse-index: integrate with cherry-pick and rebase
```

These commits integrate with `git merge`, `git cherry-pick`, `git revert`, and `git rebase` as of gitgitgadget#1019. This got some feedback that changed how the tests were working so they are more robust. This led to a new commit (0c1ecfb).

```
cbb0ab3 Merge branch 'sparse-index/merge' into vfs-2.33.0
acb8623 t7524: test no longer fails
```

Finally, the commits are merged into `vfs-2.33.0` and also we include a fix to a `microsoft/git` test that is no longer broken.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Jan 28, 2022
This branch is exactly git#410, but with one more commit: enabling the sparse index by default in d59110a.

Having this in the `vfs-2.33.0` branch helps build confidence that the sparse index is doing what it should be doing by running in the Scalar functional tests and in our test branches.

If we want to cut a new `microsoft/git` release without enabling the sparse index, we can simply revert this commit.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Jan 28, 2022
One thing I forgot when talking about the sparse index is that we have a performance test: `t/perf/p2000-sparse-operations.sh`. This test wasn't helpful for commands like `git merge` that need a particular set of input, but work for more read-only operations.

Here is a quick demonstration of how this performance test works so we could have a definitive measure of how your previous updates improved performance. 

To get these results, I ran the following command in `t/perf`:

```
 ./run 4bcd533 f9255a5 f28fc01 b713582 -- p2000-sparse-operations.sh
```

The short-shas correspond to the merge commits for these PRs:

* git#410 
* git#421 
* git#417 
* git#419

The test takes a copy of the Git repository and creates several copies within a nested directory heirarchy.


```
Test                                                   4bcd533       f9255a5              f28fc01              b713582           
-------------------------------------------------------------------------------------------------------------------------------------------------
2000.2: git status (full-v3)                           0.19(0.15+0.05)   0.19(0.16+0.05) +0.0%    0.20(0.18+0.03) +5.3%    0.19(0.17+0.04) +0.0% 
2000.3: git status (full-v4)                           0.20(0.18+0.04)   0.19(0.15+0.06) -5.0%    0.21(0.18+0.05) +5.0%    0.18(0.18+0.02) -10.0%
2000.4: git status (sparse-v3)                         0.04(0.04+0.04)   0.05(0.07+0.04) +25.0%   0.04(0.04+0.05) +0.0%    0.04(0.06+0.04) +0.0% 
2000.5: git status (sparse-v4)                         0.04(0.03+0.06)   0.04(0.05+0.05) +0.0%    0.05(0.05+0.04) +25.0%   0.05(0.06+0.04) +25.0%
2000.6: git add -A (full-v3)                           0.36(0.29+0.05)   0.38(0.28+0.07) +5.6%    0.36(0.31+0.05) +0.0%    0.37(0.31+0.05) +2.8% 
2000.7: git add -A (full-v4)                           0.34(0.27+0.06)   0.34(0.29+0.05) +0.0%    0.34(0.29+0.04) +0.0%    0.35(0.28+0.06) +2.9% 
2000.8: git add -A (sparse-v3)                         0.06(0.07+0.04)   0.06(0.05+0.06) +0.0%    0.06(0.09+0.01) +0.0%    0.06(0.08+0.03) +0.0% 
2000.9: git add -A (sparse-v4)                         0.05(0.05+0.04)   0.05(0.05+0.07) +0.0%    0.05(0.04+0.06) +0.0%    0.06(0.06+0.05) +20.0%
2000.10: git add . (full-v3)                           0.38(0.31+0.05)   0.37(0.29+0.06) -2.6%    0.37(0.30+0.07) -2.6%    0.37(0.29+0.06) -2.6% 
2000.11: git add . (full-v4)                           0.35(0.31+0.04)   0.35(0.29+0.07) +0.0%    0.35(0.29+0.05) +0.0%    0.34(0.29+0.06) -2.9% 
2000.12: git add . (sparse-v3)                         0.06(0.06+0.05)   0.06(0.05+0.06) +0.0%    0.06(0.07+0.05) +0.0%    0.06(0.09+0.03) +0.0% 
2000.13: git add . (sparse-v4)                         0.06(0.06+0.06)   0.06(0.07+0.04) +0.0%    0.05(0.06+0.05) -16.7%   0.05(0.05+0.07) -16.7%
2000.14: git commit -a -m A (full-v3)                  0.48(0.37+0.08)   0.45(0.36+0.08) -6.2%    0.45(0.35+0.09) -6.2%    0.44(0.36+0.07) -8.3% 
2000.15: git commit -a -m A (full-v4)                  0.45(0.40+0.06)   0.43(0.34+0.07) -4.4%    0.45(0.37+0.06) +0.0%    0.42(0.36+0.05) -6.7% 
2000.16: git commit -a -m A (sparse-v3)                0.05(0.05+0.06)   0.05(0.05+0.03) +0.0%    0.05(0.06+0.06) +0.0%    0.05(0.04+0.06) +0.0% 
2000.17: git commit -a -m A (sparse-v4)                0.05(0.06+0.03)   0.05(0.06+0.04) +0.0%    0.06(0.07+0.05) +20.0%   0.05(0.04+0.06) +0.0% 
2000.18: git checkout -f - (full-v3)                   0.55(0.43+0.08)   0.54(0.46+0.05) -1.8%    0.55(0.46+0.07) +0.0%    0.54(0.40+0.10) -1.8% 
2000.19: git checkout -f - (full-v4)                   0.55(0.41+0.09)   0.50(0.40+0.09) -9.1%    0.51(0.46+0.05) -7.3%    0.51(0.44+0.06) -7.3% 
2000.20: git checkout -f - (sparse-v3)                 0.06(0.09+0.03)   0.06(0.08+0.03) +0.0%    0.06(0.06+0.05) +0.0%    0.07(0.09+0.03) +16.7%
2000.21: git checkout -f - (sparse-v4)                 0.06(0.08+0.04)   0.05(0.07+0.05) -16.7%   0.05(0.07+0.04) -16.7%   0.06(0.09+0.03) +0.0% 
```

All of the above were already integrated.

```
2000.22: git reset (full-v3)                           0.41(0.32+0.06)   0.40(0.31+0.06) -2.4%    0.41(0.33+0.05) +0.0%    0.42(0.34+0.04) +2.4% 
2000.23: git reset (full-v4)                           0.37(0.32+0.05)   0.35(0.30+0.05) -5.4%    0.37(0.30+0.05) +0.0%    0.35(0.31+0.03) -5.4% 
2000.24: git reset (sparse-v3)                         0.68(0.65+0.05)   0.55(0.52+0.04) -19.1%   0.04(0.05+0.04) -94.1%   0.04(0.05+0.04) -94.1%
2000.25: git reset (sparse-v4)                         0.70(0.65+0.05)   0.54(0.50+0.06) -22.9%   0.04(0.07+0.01) -94.3%   0.03(0.05+0.05) -95.7%
2000.26: git reset --hard (full-v3)                    0.54(0.43+0.07)   0.53(0.43+0.06) -1.9%    0.55(0.46+0.05) +1.9%    0.55(0.44+0.06) +1.9% 
2000.27: git reset --hard (full-v4)                    0.50(0.45+0.03)   0.50(0.43+0.05) +0.0%    0.49(0.41+0.06) -2.0%    0.50(0.42+0.05) +0.0% 
2000.28: git reset --hard (sparse-v3)                  0.83(0.76+0.06)   0.68(0.62+0.05) -18.1%   0.07(0.05+0.02) -91.6%   0.07(0.05+0.02) -91.6%
2000.29: git reset --hard (sparse-v4)                  0.80(0.75+0.05)   0.69(0.62+0.06) -13.8%   0.07(0.04+0.02) -91.2%   0.07(0.04+0.03) -91.2%
```

As expected, `git reset [--hard]` improves with the sparse index integration, but remains constant across the full index case.

```
2000.30: git update-index --add --remove (full-v3)     0.03(0.01+0.01)   0.03(0.02+0.01) +0.0%    0.03(0.02+0.01) +0.0%    0.03(0.01+0.01) +0.0% 
2000.31: git update-index --add --remove (full-v4)     0.03(0.02+0.01)   0.03(0.02+0.01) +0.0%    0.03(0.03+0.00) +0.0%    0.03(0.02+0.01) +0.0% 
2000.32: git update-index --add --remove (sparse-v3)   0.57(0.54+0.02)   0.43(0.42+0.00) -24.6%   0.44(0.41+0.03) -22.8%   0.44(0.42+0.01) -22.8%
2000.33: git update-index --add --remove (sparse-v4)   0.56(0.52+0.04)   0.43(0.42+0.01) -23.2%   0.44(0.42+0.02) -21.4%   0.42(0.41+0.01) -25.0%
```

These do not change significantly because git#423 is not merged.

```
2000.34: git diff (full-v3)                            0.07(0.05+0.03)   0.06(0.05+0.03) -14.3%   0.07(0.05+0.03) +0.0%    0.06(0.05+0.03) -14.3%
2000.35: git diff (full-v4)                            0.06(0.05+0.03)   0.06(0.05+0.02) +0.0%    0.06(0.05+0.02) +0.0%    0.06(0.06+0.02) +0.0% 
2000.36: git diff (sparse-v3)                          0.25(0.23+0.03)   0.17(0.17+0.02) -32.0%   0.18(0.18+0.02) -28.0%   0.01(0.03+0.03) -96.0%
2000.37: git diff (sparse-v4)                          0.25(0.22+0.05)   0.16(0.16+0.01) -36.0%   0.18(0.15+0.04) -28.0%   0.01(0.04+0.02) -96.0%
2000.38: git diff --staged (full-v3)                   0.03(0.01+0.01)   0.03(0.02+0.01) +0.0%    0.03(0.02+0.01) +0.0%    0.03(0.02+0.00) +0.0% 
2000.39: git diff --staged (full-v4)                   0.04(0.03+0.01)   0.03(0.02+0.01) -25.0%   0.03(0.03+0.00) -25.0%   0.03(0.03+0.00) -25.0%
2000.40: git diff --staged (sparse-v3)                 0.21(0.19+0.01)   0.15(0.13+0.01) -28.6%   0.15(0.14+0.01) -28.6%   0.01(0.01+0.00) -95.2%
2000.41: git diff --staged (sparse-v4)                 0.22(0.21+0.01)   0.14(0.11+0.03) -36.4%   0.15(0.13+0.02) -31.8%   0.01(0.01+0.00) -95.5%
```

The `git diff` improvements are measurable.

```
2000.42: git sparse-checkout reapply (full-v3)         0.63(0.54+0.05)   0.56(0.48+0.04) -11.1%   0.57(0.48+0.03) -9.5%    0.59(0.48+0.05) -6.3% 
2000.43: git sparse-checkout reapply (full-v4)         0.60(0.54+0.02)   0.51(0.46+0.03) -15.0%   0.54(0.48+0.02) -10.0%   0.50(0.44+0.04) -16.7%
2000.44: git sparse-checkout reapply (sparse-v3)       0.91(0.86+0.05)   0.05(0.05+0.00) -94.5%   0.06(0.05+0.01) -93.4%   0.06(0.06+0.00) -93.4%
2000.45: git sparse-checkout reapply (sparse-v4)       0.92(0.88+0.04)   0.05(0.05+0.00) -94.6%   0.05(0.05+0.01) -94.6%   0.05(0.04+0.01) -94.6%
```

Finally, the `git sparse-checkout` measurements are also present.

This test script is particularly valuable when contributing changes upstream. It can be good to start by adding the lines to the performance test in an early commit, then demonstrating the performance change by copying the necessary lines from the output table into your commit message.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Mar 16, 2022
```
6e74958 p2000: add 'git checkout -' test and decrease depth
3e1d03c p2000: compress repo names
cd94f82 commit: integrate with sparse-index
65e79b8 sparse-index: recompute cache-tree
e9a9981 checkout: stop expanding sparse indexes
4b801c8 t1092: document bad 'git checkout' behavior
71e3015 unpack-trees: resolve sparse-directory/file conflicts
5e96df4 t1092: test merge conflicts outside cone
defab1b add: allow operating on a sparse-only index
9fc4313 pathspec: stop calling ensure_full_index
0ec03ab add: ignore outside the sparse-checkout in refresh()
adf5b15 add: remove ensure_full_index() with --renormalize
```

These commits are equivalent to those already in `next` via gitgitgadget#999.

```
80b8d6c Merge branch 'sparse-index/add' into stolee/sparse-index/add
```

This merge resolves conflicts with some work that happened in parallel, but is already in upstream `master`.

```
c407b2c t7519: rewrite sparse index test
9dad0d2 sparse-index: silently return when not using cone-mode patterns
2974920 sparse-index: silently return when cache tree fails
e7cdaa0 unpack-trees: fix nested sparse-dir search
347410c sparse-checkout: create helper methods
4537233 attr: be careful about sparse directories
5282a86 sparse-index: add SPARSE_INDEX_MEMORY_ONLY flag
3a2f316 sparse-checkout: clear tracked sparse dirs
fb47b56 sparse-checkout: add config to disable deleting dirs
```

These commits are the ones under review as of gitgitgadget#1009. Recent review made this less stable. It's a slightly different and more robust version of git#396.

> Note: I'm still not done with the feedback for upstream, but the remaining feedback is "can we add tests that cover these tricky technical bits?" and in `microsoft/git` these are already covered by the Scalar functional tests (since that's how they were found).

```
080b02c diff: ignore sparse paths in diffstat
d91a647 merge: make sparse-aware with ORT
df49b5f merge-ort: expand only for out-of-cone conflicts
cdecb85 t1092: add cherry-pick, rebase tests
0c1ecfb sequencer: ensure full index if not ORT strategy
406dfbe sparse-index: integrate with cherry-pick and rebase
```

These commits integrate with `git merge`, `git cherry-pick`, `git revert`, and `git rebase` as of gitgitgadget#1019. This got some feedback that changed how the tests were working so they are more robust. This led to a new commit (0c1ecfb).

```
cbb0ab3 Merge branch 'sparse-index/merge' into vfs-2.33.0
acb8623 t7524: test no longer fails
```

Finally, the commits are merged into `vfs-2.33.0` and also we include a fix to a `microsoft/git` test that is no longer broken.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Jun 23, 2022
One thing I forgot when talking about the sparse index is that we have a performance test: `t/perf/p2000-sparse-operations.sh`. This test wasn't helpful for commands like `git merge` that need a particular set of input, but work for more read-only operations.

Here is a quick demonstration of how this performance test works so we could have a definitive measure of how your previous updates improved performance. 

To get these results, I ran the following command in `t/perf`:

```
 ./run 4bcd533 f9255a5 f28fc01 b713582 -- p2000-sparse-operations.sh
```

The short-shas correspond to the merge commits for these PRs:

* git#410 
* git#421 
* git#417 
* git#419

The test takes a copy of the Git repository and creates several copies within a nested directory heirarchy.


```
Test                                                   4bcd533       f9255a5              f28fc01              b713582           
-------------------------------------------------------------------------------------------------------------------------------------------------
2000.2: git status (full-v3)                           0.19(0.15+0.05)   0.19(0.16+0.05) +0.0%    0.20(0.18+0.03) +5.3%    0.19(0.17+0.04) +0.0% 
2000.3: git status (full-v4)                           0.20(0.18+0.04)   0.19(0.15+0.06) -5.0%    0.21(0.18+0.05) +5.0%    0.18(0.18+0.02) -10.0%
2000.4: git status (sparse-v3)                         0.04(0.04+0.04)   0.05(0.07+0.04) +25.0%   0.04(0.04+0.05) +0.0%    0.04(0.06+0.04) +0.0% 
2000.5: git status (sparse-v4)                         0.04(0.03+0.06)   0.04(0.05+0.05) +0.0%    0.05(0.05+0.04) +25.0%   0.05(0.06+0.04) +25.0%
2000.6: git add -A (full-v3)                           0.36(0.29+0.05)   0.38(0.28+0.07) +5.6%    0.36(0.31+0.05) +0.0%    0.37(0.31+0.05) +2.8% 
2000.7: git add -A (full-v4)                           0.34(0.27+0.06)   0.34(0.29+0.05) +0.0%    0.34(0.29+0.04) +0.0%    0.35(0.28+0.06) +2.9% 
2000.8: git add -A (sparse-v3)                         0.06(0.07+0.04)   0.06(0.05+0.06) +0.0%    0.06(0.09+0.01) +0.0%    0.06(0.08+0.03) +0.0% 
2000.9: git add -A (sparse-v4)                         0.05(0.05+0.04)   0.05(0.05+0.07) +0.0%    0.05(0.04+0.06) +0.0%    0.06(0.06+0.05) +20.0%
2000.10: git add . (full-v3)                           0.38(0.31+0.05)   0.37(0.29+0.06) -2.6%    0.37(0.30+0.07) -2.6%    0.37(0.29+0.06) -2.6% 
2000.11: git add . (full-v4)                           0.35(0.31+0.04)   0.35(0.29+0.07) +0.0%    0.35(0.29+0.05) +0.0%    0.34(0.29+0.06) -2.9% 
2000.12: git add . (sparse-v3)                         0.06(0.06+0.05)   0.06(0.05+0.06) +0.0%    0.06(0.07+0.05) +0.0%    0.06(0.09+0.03) +0.0% 
2000.13: git add . (sparse-v4)                         0.06(0.06+0.06)   0.06(0.07+0.04) +0.0%    0.05(0.06+0.05) -16.7%   0.05(0.05+0.07) -16.7%
2000.14: git commit -a -m A (full-v3)                  0.48(0.37+0.08)   0.45(0.36+0.08) -6.2%    0.45(0.35+0.09) -6.2%    0.44(0.36+0.07) -8.3% 
2000.15: git commit -a -m A (full-v4)                  0.45(0.40+0.06)   0.43(0.34+0.07) -4.4%    0.45(0.37+0.06) +0.0%    0.42(0.36+0.05) -6.7% 
2000.16: git commit -a -m A (sparse-v3)                0.05(0.05+0.06)   0.05(0.05+0.03) +0.0%    0.05(0.06+0.06) +0.0%    0.05(0.04+0.06) +0.0% 
2000.17: git commit -a -m A (sparse-v4)                0.05(0.06+0.03)   0.05(0.06+0.04) +0.0%    0.06(0.07+0.05) +20.0%   0.05(0.04+0.06) +0.0% 
2000.18: git checkout -f - (full-v3)                   0.55(0.43+0.08)   0.54(0.46+0.05) -1.8%    0.55(0.46+0.07) +0.0%    0.54(0.40+0.10) -1.8% 
2000.19: git checkout -f - (full-v4)                   0.55(0.41+0.09)   0.50(0.40+0.09) -9.1%    0.51(0.46+0.05) -7.3%    0.51(0.44+0.06) -7.3% 
2000.20: git checkout -f - (sparse-v3)                 0.06(0.09+0.03)   0.06(0.08+0.03) +0.0%    0.06(0.06+0.05) +0.0%    0.07(0.09+0.03) +16.7%
2000.21: git checkout -f - (sparse-v4)                 0.06(0.08+0.04)   0.05(0.07+0.05) -16.7%   0.05(0.07+0.04) -16.7%   0.06(0.09+0.03) +0.0% 
```

All of the above were already integrated.

```
2000.22: git reset (full-v3)                           0.41(0.32+0.06)   0.40(0.31+0.06) -2.4%    0.41(0.33+0.05) +0.0%    0.42(0.34+0.04) +2.4% 
2000.23: git reset (full-v4)                           0.37(0.32+0.05)   0.35(0.30+0.05) -5.4%    0.37(0.30+0.05) +0.0%    0.35(0.31+0.03) -5.4% 
2000.24: git reset (sparse-v3)                         0.68(0.65+0.05)   0.55(0.52+0.04) -19.1%   0.04(0.05+0.04) -94.1%   0.04(0.05+0.04) -94.1%
2000.25: git reset (sparse-v4)                         0.70(0.65+0.05)   0.54(0.50+0.06) -22.9%   0.04(0.07+0.01) -94.3%   0.03(0.05+0.05) -95.7%
2000.26: git reset --hard (full-v3)                    0.54(0.43+0.07)   0.53(0.43+0.06) -1.9%    0.55(0.46+0.05) +1.9%    0.55(0.44+0.06) +1.9% 
2000.27: git reset --hard (full-v4)                    0.50(0.45+0.03)   0.50(0.43+0.05) +0.0%    0.49(0.41+0.06) -2.0%    0.50(0.42+0.05) +0.0% 
2000.28: git reset --hard (sparse-v3)                  0.83(0.76+0.06)   0.68(0.62+0.05) -18.1%   0.07(0.05+0.02) -91.6%   0.07(0.05+0.02) -91.6%
2000.29: git reset --hard (sparse-v4)                  0.80(0.75+0.05)   0.69(0.62+0.06) -13.8%   0.07(0.04+0.02) -91.2%   0.07(0.04+0.03) -91.2%
```

As expected, `git reset [--hard]` improves with the sparse index integration, but remains constant across the full index case.

```
2000.30: git update-index --add --remove (full-v3)     0.03(0.01+0.01)   0.03(0.02+0.01) +0.0%    0.03(0.02+0.01) +0.0%    0.03(0.01+0.01) +0.0% 
2000.31: git update-index --add --remove (full-v4)     0.03(0.02+0.01)   0.03(0.02+0.01) +0.0%    0.03(0.03+0.00) +0.0%    0.03(0.02+0.01) +0.0% 
2000.32: git update-index --add --remove (sparse-v3)   0.57(0.54+0.02)   0.43(0.42+0.00) -24.6%   0.44(0.41+0.03) -22.8%   0.44(0.42+0.01) -22.8%
2000.33: git update-index --add --remove (sparse-v4)   0.56(0.52+0.04)   0.43(0.42+0.01) -23.2%   0.44(0.42+0.02) -21.4%   0.42(0.41+0.01) -25.0%
```

These do not change significantly because git#423 is not merged.

```
2000.34: git diff (full-v3)                            0.07(0.05+0.03)   0.06(0.05+0.03) -14.3%   0.07(0.05+0.03) +0.0%    0.06(0.05+0.03) -14.3%
2000.35: git diff (full-v4)                            0.06(0.05+0.03)   0.06(0.05+0.02) +0.0%    0.06(0.05+0.02) +0.0%    0.06(0.06+0.02) +0.0% 
2000.36: git diff (sparse-v3)                          0.25(0.23+0.03)   0.17(0.17+0.02) -32.0%   0.18(0.18+0.02) -28.0%   0.01(0.03+0.03) -96.0%
2000.37: git diff (sparse-v4)                          0.25(0.22+0.05)   0.16(0.16+0.01) -36.0%   0.18(0.15+0.04) -28.0%   0.01(0.04+0.02) -96.0%
2000.38: git diff --staged (full-v3)                   0.03(0.01+0.01)   0.03(0.02+0.01) +0.0%    0.03(0.02+0.01) +0.0%    0.03(0.02+0.00) +0.0% 
2000.39: git diff --staged (full-v4)                   0.04(0.03+0.01)   0.03(0.02+0.01) -25.0%   0.03(0.03+0.00) -25.0%   0.03(0.03+0.00) -25.0%
2000.40: git diff --staged (sparse-v3)                 0.21(0.19+0.01)   0.15(0.13+0.01) -28.6%   0.15(0.14+0.01) -28.6%   0.01(0.01+0.00) -95.2%
2000.41: git diff --staged (sparse-v4)                 0.22(0.21+0.01)   0.14(0.11+0.03) -36.4%   0.15(0.13+0.02) -31.8%   0.01(0.01+0.00) -95.5%
```

The `git diff` improvements are measurable.

```
2000.42: git sparse-checkout reapply (full-v3)         0.63(0.54+0.05)   0.56(0.48+0.04) -11.1%   0.57(0.48+0.03) -9.5%    0.59(0.48+0.05) -6.3% 
2000.43: git sparse-checkout reapply (full-v4)         0.60(0.54+0.02)   0.51(0.46+0.03) -15.0%   0.54(0.48+0.02) -10.0%   0.50(0.44+0.04) -16.7%
2000.44: git sparse-checkout reapply (sparse-v3)       0.91(0.86+0.05)   0.05(0.05+0.00) -94.5%   0.06(0.05+0.01) -93.4%   0.06(0.06+0.00) -93.4%
2000.45: git sparse-checkout reapply (sparse-v4)       0.92(0.88+0.04)   0.05(0.05+0.00) -94.6%   0.05(0.05+0.01) -94.6%   0.05(0.04+0.01) -94.6%
```

Finally, the `git sparse-checkout` measurements are also present.

This test script is particularly valuable when contributing changes upstream. It can be good to start by adding the lines to the performance test in an early commit, then demonstrating the performance change by copying the necessary lines from the output table into your commit message.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Jun 27, 2022
```
6e74958 p2000: add 'git checkout -' test and decrease depth
3e1d03c p2000: compress repo names
cd94f82 commit: integrate with sparse-index
65e79b8 sparse-index: recompute cache-tree
e9a9981 checkout: stop expanding sparse indexes
4b801c8 t1092: document bad 'git checkout' behavior
71e3015 unpack-trees: resolve sparse-directory/file conflicts
5e96df4 t1092: test merge conflicts outside cone
defab1b add: allow operating on a sparse-only index
9fc4313 pathspec: stop calling ensure_full_index
0ec03ab add: ignore outside the sparse-checkout in refresh()
adf5b15 add: remove ensure_full_index() with --renormalize
```

These commits are equivalent to those already in `next` via gitgitgadget#999.

```
80b8d6c Merge branch 'sparse-index/add' into stolee/sparse-index/add
```

This merge resolves conflicts with some work that happened in parallel, but is already in upstream `master`.

```
c407b2c t7519: rewrite sparse index test
9dad0d2 sparse-index: silently return when not using cone-mode patterns
2974920 sparse-index: silently return when cache tree fails
e7cdaa0 unpack-trees: fix nested sparse-dir search
347410c sparse-checkout: create helper methods
4537233 attr: be careful about sparse directories
5282a86 sparse-index: add SPARSE_INDEX_MEMORY_ONLY flag
3a2f316 sparse-checkout: clear tracked sparse dirs
fb47b56 sparse-checkout: add config to disable deleting dirs
```

These commits are the ones under review as of gitgitgadget#1009. Recent review made this less stable. It's a slightly different and more robust version of git#396.

> Note: I'm still not done with the feedback for upstream, but the remaining feedback is "can we add tests that cover these tricky technical bits?" and in `microsoft/git` these are already covered by the Scalar functional tests (since that's how they were found).

```
080b02c diff: ignore sparse paths in diffstat
d91a647 merge: make sparse-aware with ORT
df49b5f merge-ort: expand only for out-of-cone conflicts
cdecb85 t1092: add cherry-pick, rebase tests
0c1ecfb sequencer: ensure full index if not ORT strategy
406dfbe sparse-index: integrate with cherry-pick and rebase
```

These commits integrate with `git merge`, `git cherry-pick`, `git revert`, and `git rebase` as of gitgitgadget#1019. This got some feedback that changed how the tests were working so they are more robust. This led to a new commit (0c1ecfb).

```
cbb0ab3 Merge branch 'sparse-index/merge' into vfs-2.33.0
acb8623 t7524: test no longer fails
```

Finally, the commits are merged into `vfs-2.33.0` and also we include a fix to a `microsoft/git` test that is no longer broken.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Jun 27, 2022
This branch is exactly git#410, but with one more commit: enabling the sparse index by default in d59110a.

Having this in the `vfs-2.33.0` branch helps build confidence that the sparse index is doing what it should be doing by running in the Scalar functional tests and in our test branches.

If we want to cut a new `microsoft/git` release without enabling the sparse index, we can simply revert this commit.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Jun 27, 2022
One thing I forgot when talking about the sparse index is that we have a performance test: `t/perf/p2000-sparse-operations.sh`. This test wasn't helpful for commands like `git merge` that need a particular set of input, but work for more read-only operations.

Here is a quick demonstration of how this performance test works so we could have a definitive measure of how your previous updates improved performance. 

To get these results, I ran the following command in `t/perf`:

```
 ./run 4bcd533 f9255a5 f28fc01 b713582 -- p2000-sparse-operations.sh
```

The short-shas correspond to the merge commits for these PRs:

* git#410 
* git#421 
* git#417 
* git#419

The test takes a copy of the Git repository and creates several copies within a nested directory heirarchy.


```
Test                                                   4bcd533       f9255a5              f28fc01              b713582           
-------------------------------------------------------------------------------------------------------------------------------------------------
2000.2: git status (full-v3)                           0.19(0.15+0.05)   0.19(0.16+0.05) +0.0%    0.20(0.18+0.03) +5.3%    0.19(0.17+0.04) +0.0% 
2000.3: git status (full-v4)                           0.20(0.18+0.04)   0.19(0.15+0.06) -5.0%    0.21(0.18+0.05) +5.0%    0.18(0.18+0.02) -10.0%
2000.4: git status (sparse-v3)                         0.04(0.04+0.04)   0.05(0.07+0.04) +25.0%   0.04(0.04+0.05) +0.0%    0.04(0.06+0.04) +0.0% 
2000.5: git status (sparse-v4)                         0.04(0.03+0.06)   0.04(0.05+0.05) +0.0%    0.05(0.05+0.04) +25.0%   0.05(0.06+0.04) +25.0%
2000.6: git add -A (full-v3)                           0.36(0.29+0.05)   0.38(0.28+0.07) +5.6%    0.36(0.31+0.05) +0.0%    0.37(0.31+0.05) +2.8% 
2000.7: git add -A (full-v4)                           0.34(0.27+0.06)   0.34(0.29+0.05) +0.0%    0.34(0.29+0.04) +0.0%    0.35(0.28+0.06) +2.9% 
2000.8: git add -A (sparse-v3)                         0.06(0.07+0.04)   0.06(0.05+0.06) +0.0%    0.06(0.09+0.01) +0.0%    0.06(0.08+0.03) +0.0% 
2000.9: git add -A (sparse-v4)                         0.05(0.05+0.04)   0.05(0.05+0.07) +0.0%    0.05(0.04+0.06) +0.0%    0.06(0.06+0.05) +20.0%
2000.10: git add . (full-v3)                           0.38(0.31+0.05)   0.37(0.29+0.06) -2.6%    0.37(0.30+0.07) -2.6%    0.37(0.29+0.06) -2.6% 
2000.11: git add . (full-v4)                           0.35(0.31+0.04)   0.35(0.29+0.07) +0.0%    0.35(0.29+0.05) +0.0%    0.34(0.29+0.06) -2.9% 
2000.12: git add . (sparse-v3)                         0.06(0.06+0.05)   0.06(0.05+0.06) +0.0%    0.06(0.07+0.05) +0.0%    0.06(0.09+0.03) +0.0% 
2000.13: git add . (sparse-v4)                         0.06(0.06+0.06)   0.06(0.07+0.04) +0.0%    0.05(0.06+0.05) -16.7%   0.05(0.05+0.07) -16.7%
2000.14: git commit -a -m A (full-v3)                  0.48(0.37+0.08)   0.45(0.36+0.08) -6.2%    0.45(0.35+0.09) -6.2%    0.44(0.36+0.07) -8.3% 
2000.15: git commit -a -m A (full-v4)                  0.45(0.40+0.06)   0.43(0.34+0.07) -4.4%    0.45(0.37+0.06) +0.0%    0.42(0.36+0.05) -6.7% 
2000.16: git commit -a -m A (sparse-v3)                0.05(0.05+0.06)   0.05(0.05+0.03) +0.0%    0.05(0.06+0.06) +0.0%    0.05(0.04+0.06) +0.0% 
2000.17: git commit -a -m A (sparse-v4)                0.05(0.06+0.03)   0.05(0.06+0.04) +0.0%    0.06(0.07+0.05) +20.0%   0.05(0.04+0.06) +0.0% 
2000.18: git checkout -f - (full-v3)                   0.55(0.43+0.08)   0.54(0.46+0.05) -1.8%    0.55(0.46+0.07) +0.0%    0.54(0.40+0.10) -1.8% 
2000.19: git checkout -f - (full-v4)                   0.55(0.41+0.09)   0.50(0.40+0.09) -9.1%    0.51(0.46+0.05) -7.3%    0.51(0.44+0.06) -7.3% 
2000.20: git checkout -f - (sparse-v3)                 0.06(0.09+0.03)   0.06(0.08+0.03) +0.0%    0.06(0.06+0.05) +0.0%    0.07(0.09+0.03) +16.7%
2000.21: git checkout -f - (sparse-v4)                 0.06(0.08+0.04)   0.05(0.07+0.05) -16.7%   0.05(0.07+0.04) -16.7%   0.06(0.09+0.03) +0.0% 
```

All of the above were already integrated.

```
2000.22: git reset (full-v3)                           0.41(0.32+0.06)   0.40(0.31+0.06) -2.4%    0.41(0.33+0.05) +0.0%    0.42(0.34+0.04) +2.4% 
2000.23: git reset (full-v4)                           0.37(0.32+0.05)   0.35(0.30+0.05) -5.4%    0.37(0.30+0.05) +0.0%    0.35(0.31+0.03) -5.4% 
2000.24: git reset (sparse-v3)                         0.68(0.65+0.05)   0.55(0.52+0.04) -19.1%   0.04(0.05+0.04) -94.1%   0.04(0.05+0.04) -94.1%
2000.25: git reset (sparse-v4)                         0.70(0.65+0.05)   0.54(0.50+0.06) -22.9%   0.04(0.07+0.01) -94.3%   0.03(0.05+0.05) -95.7%
2000.26: git reset --hard (full-v3)                    0.54(0.43+0.07)   0.53(0.43+0.06) -1.9%    0.55(0.46+0.05) +1.9%    0.55(0.44+0.06) +1.9% 
2000.27: git reset --hard (full-v4)                    0.50(0.45+0.03)   0.50(0.43+0.05) +0.0%    0.49(0.41+0.06) -2.0%    0.50(0.42+0.05) +0.0% 
2000.28: git reset --hard (sparse-v3)                  0.83(0.76+0.06)   0.68(0.62+0.05) -18.1%   0.07(0.05+0.02) -91.6%   0.07(0.05+0.02) -91.6%
2000.29: git reset --hard (sparse-v4)                  0.80(0.75+0.05)   0.69(0.62+0.06) -13.8%   0.07(0.04+0.02) -91.2%   0.07(0.04+0.03) -91.2%
```

As expected, `git reset [--hard]` improves with the sparse index integration, but remains constant across the full index case.

```
2000.30: git update-index --add --remove (full-v3)     0.03(0.01+0.01)   0.03(0.02+0.01) +0.0%    0.03(0.02+0.01) +0.0%    0.03(0.01+0.01) +0.0% 
2000.31: git update-index --add --remove (full-v4)     0.03(0.02+0.01)   0.03(0.02+0.01) +0.0%    0.03(0.03+0.00) +0.0%    0.03(0.02+0.01) +0.0% 
2000.32: git update-index --add --remove (sparse-v3)   0.57(0.54+0.02)   0.43(0.42+0.00) -24.6%   0.44(0.41+0.03) -22.8%   0.44(0.42+0.01) -22.8%
2000.33: git update-index --add --remove (sparse-v4)   0.56(0.52+0.04)   0.43(0.42+0.01) -23.2%   0.44(0.42+0.02) -21.4%   0.42(0.41+0.01) -25.0%
```

These do not change significantly because git#423 is not merged.

```
2000.34: git diff (full-v3)                            0.07(0.05+0.03)   0.06(0.05+0.03) -14.3%   0.07(0.05+0.03) +0.0%    0.06(0.05+0.03) -14.3%
2000.35: git diff (full-v4)                            0.06(0.05+0.03)   0.06(0.05+0.02) +0.0%    0.06(0.05+0.02) +0.0%    0.06(0.06+0.02) +0.0% 
2000.36: git diff (sparse-v3)                          0.25(0.23+0.03)   0.17(0.17+0.02) -32.0%   0.18(0.18+0.02) -28.0%   0.01(0.03+0.03) -96.0%
2000.37: git diff (sparse-v4)                          0.25(0.22+0.05)   0.16(0.16+0.01) -36.0%   0.18(0.15+0.04) -28.0%   0.01(0.04+0.02) -96.0%
2000.38: git diff --staged (full-v3)                   0.03(0.01+0.01)   0.03(0.02+0.01) +0.0%    0.03(0.02+0.01) +0.0%    0.03(0.02+0.00) +0.0% 
2000.39: git diff --staged (full-v4)                   0.04(0.03+0.01)   0.03(0.02+0.01) -25.0%   0.03(0.03+0.00) -25.0%   0.03(0.03+0.00) -25.0%
2000.40: git diff --staged (sparse-v3)                 0.21(0.19+0.01)   0.15(0.13+0.01) -28.6%   0.15(0.14+0.01) -28.6%   0.01(0.01+0.00) -95.2%
2000.41: git diff --staged (sparse-v4)                 0.22(0.21+0.01)   0.14(0.11+0.03) -36.4%   0.15(0.13+0.02) -31.8%   0.01(0.01+0.00) -95.5%
```

The `git diff` improvements are measurable.

```
2000.42: git sparse-checkout reapply (full-v3)         0.63(0.54+0.05)   0.56(0.48+0.04) -11.1%   0.57(0.48+0.03) -9.5%    0.59(0.48+0.05) -6.3% 
2000.43: git sparse-checkout reapply (full-v4)         0.60(0.54+0.02)   0.51(0.46+0.03) -15.0%   0.54(0.48+0.02) -10.0%   0.50(0.44+0.04) -16.7%
2000.44: git sparse-checkout reapply (sparse-v3)       0.91(0.86+0.05)   0.05(0.05+0.00) -94.5%   0.06(0.05+0.01) -93.4%   0.06(0.06+0.00) -93.4%
2000.45: git sparse-checkout reapply (sparse-v4)       0.92(0.88+0.04)   0.05(0.05+0.00) -94.6%   0.05(0.05+0.01) -94.6%   0.05(0.04+0.01) -94.6%
```

Finally, the `git sparse-checkout` measurements are also present.

This test script is particularly valuable when contributing changes upstream. It can be good to start by adding the lines to the performance test in an early commit, then demonstrating the performance change by copying the necessary lines from the output table into your commit message.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Jul 14, 2022
```
6e74958 p2000: add 'git checkout -' test and decrease depth
3e1d03c p2000: compress repo names
cd94f82 commit: integrate with sparse-index
65e79b8 sparse-index: recompute cache-tree
e9a9981 checkout: stop expanding sparse indexes
4b801c8 t1092: document bad 'git checkout' behavior
71e3015 unpack-trees: resolve sparse-directory/file conflicts
5e96df4 t1092: test merge conflicts outside cone
defab1b add: allow operating on a sparse-only index
9fc4313 pathspec: stop calling ensure_full_index
0ec03ab add: ignore outside the sparse-checkout in refresh()
adf5b15 add: remove ensure_full_index() with --renormalize
```

These commits are equivalent to those already in `next` via gitgitgadget#999.

```
80b8d6c Merge branch 'sparse-index/add' into stolee/sparse-index/add
```

This merge resolves conflicts with some work that happened in parallel, but is already in upstream `master`.

```
c407b2c t7519: rewrite sparse index test
9dad0d2 sparse-index: silently return when not using cone-mode patterns
2974920 sparse-index: silently return when cache tree fails
e7cdaa0 unpack-trees: fix nested sparse-dir search
347410c sparse-checkout: create helper methods
4537233 attr: be careful about sparse directories
5282a86 sparse-index: add SPARSE_INDEX_MEMORY_ONLY flag
3a2f316 sparse-checkout: clear tracked sparse dirs
fb47b56 sparse-checkout: add config to disable deleting dirs
```

These commits are the ones under review as of gitgitgadget#1009. Recent review made this less stable. It's a slightly different and more robust version of git#396.

> Note: I'm still not done with the feedback for upstream, but the remaining feedback is "can we add tests that cover these tricky technical bits?" and in `microsoft/git` these are already covered by the Scalar functional tests (since that's how they were found).

```
080b02c diff: ignore sparse paths in diffstat
d91a647 merge: make sparse-aware with ORT
df49b5f merge-ort: expand only for out-of-cone conflicts
cdecb85 t1092: add cherry-pick, rebase tests
0c1ecfb sequencer: ensure full index if not ORT strategy
406dfbe sparse-index: integrate with cherry-pick and rebase
```

These commits integrate with `git merge`, `git cherry-pick`, `git revert`, and `git rebase` as of gitgitgadget#1019. This got some feedback that changed how the tests were working so they are more robust. This led to a new commit (0c1ecfb).

```
cbb0ab3 Merge branch 'sparse-index/merge' into vfs-2.33.0
acb8623 t7524: test no longer fails
```

Finally, the commits are merged into `vfs-2.33.0` and also we include a fix to a `microsoft/git` test that is no longer broken.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Jul 14, 2022
This branch is exactly git#410, but with one more commit: enabling the sparse index by default in d59110a.

Having this in the `vfs-2.33.0` branch helps build confidence that the sparse index is doing what it should be doing by running in the Scalar functional tests and in our test branches.

If we want to cut a new `microsoft/git` release without enabling the sparse index, we can simply revert this commit.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Jul 14, 2022
One thing I forgot when talking about the sparse index is that we have a performance test: `t/perf/p2000-sparse-operations.sh`. This test wasn't helpful for commands like `git merge` that need a particular set of input, but work for more read-only operations.

Here is a quick demonstration of how this performance test works so we could have a definitive measure of how your previous updates improved performance. 

To get these results, I ran the following command in `t/perf`:

```
 ./run 4bcd533 f9255a5 f28fc01 b713582 -- p2000-sparse-operations.sh
```

The short-shas correspond to the merge commits for these PRs:

* git#410 
* git#421 
* git#417 
* git#419

The test takes a copy of the Git repository and creates several copies within a nested directory heirarchy.


```
Test                                                   4bcd533       f9255a5              f28fc01              b713582           
-------------------------------------------------------------------------------------------------------------------------------------------------
2000.2: git status (full-v3)                           0.19(0.15+0.05)   0.19(0.16+0.05) +0.0%    0.20(0.18+0.03) +5.3%    0.19(0.17+0.04) +0.0% 
2000.3: git status (full-v4)                           0.20(0.18+0.04)   0.19(0.15+0.06) -5.0%    0.21(0.18+0.05) +5.0%    0.18(0.18+0.02) -10.0%
2000.4: git status (sparse-v3)                         0.04(0.04+0.04)   0.05(0.07+0.04) +25.0%   0.04(0.04+0.05) +0.0%    0.04(0.06+0.04) +0.0% 
2000.5: git status (sparse-v4)                         0.04(0.03+0.06)   0.04(0.05+0.05) +0.0%    0.05(0.05+0.04) +25.0%   0.05(0.06+0.04) +25.0%
2000.6: git add -A (full-v3)                           0.36(0.29+0.05)   0.38(0.28+0.07) +5.6%    0.36(0.31+0.05) +0.0%    0.37(0.31+0.05) +2.8% 
2000.7: git add -A (full-v4)                           0.34(0.27+0.06)   0.34(0.29+0.05) +0.0%    0.34(0.29+0.04) +0.0%    0.35(0.28+0.06) +2.9% 
2000.8: git add -A (sparse-v3)                         0.06(0.07+0.04)   0.06(0.05+0.06) +0.0%    0.06(0.09+0.01) +0.0%    0.06(0.08+0.03) +0.0% 
2000.9: git add -A (sparse-v4)                         0.05(0.05+0.04)   0.05(0.05+0.07) +0.0%    0.05(0.04+0.06) +0.0%    0.06(0.06+0.05) +20.0%
2000.10: git add . (full-v3)                           0.38(0.31+0.05)   0.37(0.29+0.06) -2.6%    0.37(0.30+0.07) -2.6%    0.37(0.29+0.06) -2.6% 
2000.11: git add . (full-v4)                           0.35(0.31+0.04)   0.35(0.29+0.07) +0.0%    0.35(0.29+0.05) +0.0%    0.34(0.29+0.06) -2.9% 
2000.12: git add . (sparse-v3)                         0.06(0.06+0.05)   0.06(0.05+0.06) +0.0%    0.06(0.07+0.05) +0.0%    0.06(0.09+0.03) +0.0% 
2000.13: git add . (sparse-v4)                         0.06(0.06+0.06)   0.06(0.07+0.04) +0.0%    0.05(0.06+0.05) -16.7%   0.05(0.05+0.07) -16.7%
2000.14: git commit -a -m A (full-v3)                  0.48(0.37+0.08)   0.45(0.36+0.08) -6.2%    0.45(0.35+0.09) -6.2%    0.44(0.36+0.07) -8.3% 
2000.15: git commit -a -m A (full-v4)                  0.45(0.40+0.06)   0.43(0.34+0.07) -4.4%    0.45(0.37+0.06) +0.0%    0.42(0.36+0.05) -6.7% 
2000.16: git commit -a -m A (sparse-v3)                0.05(0.05+0.06)   0.05(0.05+0.03) +0.0%    0.05(0.06+0.06) +0.0%    0.05(0.04+0.06) +0.0% 
2000.17: git commit -a -m A (sparse-v4)                0.05(0.06+0.03)   0.05(0.06+0.04) +0.0%    0.06(0.07+0.05) +20.0%   0.05(0.04+0.06) +0.0% 
2000.18: git checkout -f - (full-v3)                   0.55(0.43+0.08)   0.54(0.46+0.05) -1.8%    0.55(0.46+0.07) +0.0%    0.54(0.40+0.10) -1.8% 
2000.19: git checkout -f - (full-v4)                   0.55(0.41+0.09)   0.50(0.40+0.09) -9.1%    0.51(0.46+0.05) -7.3%    0.51(0.44+0.06) -7.3% 
2000.20: git checkout -f - (sparse-v3)                 0.06(0.09+0.03)   0.06(0.08+0.03) +0.0%    0.06(0.06+0.05) +0.0%    0.07(0.09+0.03) +16.7%
2000.21: git checkout -f - (sparse-v4)                 0.06(0.08+0.04)   0.05(0.07+0.05) -16.7%   0.05(0.07+0.04) -16.7%   0.06(0.09+0.03) +0.0% 
```

All of the above were already integrated.

```
2000.22: git reset (full-v3)                           0.41(0.32+0.06)   0.40(0.31+0.06) -2.4%    0.41(0.33+0.05) +0.0%    0.42(0.34+0.04) +2.4% 
2000.23: git reset (full-v4)                           0.37(0.32+0.05)   0.35(0.30+0.05) -5.4%    0.37(0.30+0.05) +0.0%    0.35(0.31+0.03) -5.4% 
2000.24: git reset (sparse-v3)                         0.68(0.65+0.05)   0.55(0.52+0.04) -19.1%   0.04(0.05+0.04) -94.1%   0.04(0.05+0.04) -94.1%
2000.25: git reset (sparse-v4)                         0.70(0.65+0.05)   0.54(0.50+0.06) -22.9%   0.04(0.07+0.01) -94.3%   0.03(0.05+0.05) -95.7%
2000.26: git reset --hard (full-v3)                    0.54(0.43+0.07)   0.53(0.43+0.06) -1.9%    0.55(0.46+0.05) +1.9%    0.55(0.44+0.06) +1.9% 
2000.27: git reset --hard (full-v4)                    0.50(0.45+0.03)   0.50(0.43+0.05) +0.0%    0.49(0.41+0.06) -2.0%    0.50(0.42+0.05) +0.0% 
2000.28: git reset --hard (sparse-v3)                  0.83(0.76+0.06)   0.68(0.62+0.05) -18.1%   0.07(0.05+0.02) -91.6%   0.07(0.05+0.02) -91.6%
2000.29: git reset --hard (sparse-v4)                  0.80(0.75+0.05)   0.69(0.62+0.06) -13.8%   0.07(0.04+0.02) -91.2%   0.07(0.04+0.03) -91.2%
```

As expected, `git reset [--hard]` improves with the sparse index integration, but remains constant across the full index case.

```
2000.30: git update-index --add --remove (full-v3)     0.03(0.01+0.01)   0.03(0.02+0.01) +0.0%    0.03(0.02+0.01) +0.0%    0.03(0.01+0.01) +0.0% 
2000.31: git update-index --add --remove (full-v4)     0.03(0.02+0.01)   0.03(0.02+0.01) +0.0%    0.03(0.03+0.00) +0.0%    0.03(0.02+0.01) +0.0% 
2000.32: git update-index --add --remove (sparse-v3)   0.57(0.54+0.02)   0.43(0.42+0.00) -24.6%   0.44(0.41+0.03) -22.8%   0.44(0.42+0.01) -22.8%
2000.33: git update-index --add --remove (sparse-v4)   0.56(0.52+0.04)   0.43(0.42+0.01) -23.2%   0.44(0.42+0.02) -21.4%   0.42(0.41+0.01) -25.0%
```

These do not change significantly because git#423 is not merged.

```
2000.34: git diff (full-v3)                            0.07(0.05+0.03)   0.06(0.05+0.03) -14.3%   0.07(0.05+0.03) +0.0%    0.06(0.05+0.03) -14.3%
2000.35: git diff (full-v4)                            0.06(0.05+0.03)   0.06(0.05+0.02) +0.0%    0.06(0.05+0.02) +0.0%    0.06(0.06+0.02) +0.0% 
2000.36: git diff (sparse-v3)                          0.25(0.23+0.03)   0.17(0.17+0.02) -32.0%   0.18(0.18+0.02) -28.0%   0.01(0.03+0.03) -96.0%
2000.37: git diff (sparse-v4)                          0.25(0.22+0.05)   0.16(0.16+0.01) -36.0%   0.18(0.15+0.04) -28.0%   0.01(0.04+0.02) -96.0%
2000.38: git diff --staged (full-v3)                   0.03(0.01+0.01)   0.03(0.02+0.01) +0.0%    0.03(0.02+0.01) +0.0%    0.03(0.02+0.00) +0.0% 
2000.39: git diff --staged (full-v4)                   0.04(0.03+0.01)   0.03(0.02+0.01) -25.0%   0.03(0.03+0.00) -25.0%   0.03(0.03+0.00) -25.0%
2000.40: git diff --staged (sparse-v3)                 0.21(0.19+0.01)   0.15(0.13+0.01) -28.6%   0.15(0.14+0.01) -28.6%   0.01(0.01+0.00) -95.2%
2000.41: git diff --staged (sparse-v4)                 0.22(0.21+0.01)   0.14(0.11+0.03) -36.4%   0.15(0.13+0.02) -31.8%   0.01(0.01+0.00) -95.5%
```

The `git diff` improvements are measurable.

```
2000.42: git sparse-checkout reapply (full-v3)         0.63(0.54+0.05)   0.56(0.48+0.04) -11.1%   0.57(0.48+0.03) -9.5%    0.59(0.48+0.05) -6.3% 
2000.43: git sparse-checkout reapply (full-v4)         0.60(0.54+0.02)   0.51(0.46+0.03) -15.0%   0.54(0.48+0.02) -10.0%   0.50(0.44+0.04) -16.7%
2000.44: git sparse-checkout reapply (sparse-v3)       0.91(0.86+0.05)   0.05(0.05+0.00) -94.5%   0.06(0.05+0.01) -93.4%   0.06(0.06+0.00) -93.4%
2000.45: git sparse-checkout reapply (sparse-v4)       0.92(0.88+0.04)   0.05(0.05+0.00) -94.6%   0.05(0.05+0.01) -94.6%   0.05(0.04+0.01) -94.6%
```

Finally, the `git sparse-checkout` measurements are also present.

This test script is particularly valuable when contributing changes upstream. It can be good to start by adding the lines to the performance test in an early commit, then demonstrating the performance change by copying the necessary lines from the output table into your commit message.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Sep 30, 2022
```
6e74958 p2000: add 'git checkout -' test and decrease depth
3e1d03c p2000: compress repo names
cd94f82 commit: integrate with sparse-index
65e79b8 sparse-index: recompute cache-tree
e9a9981 checkout: stop expanding sparse indexes
4b801c8 t1092: document bad 'git checkout' behavior
71e3015 unpack-trees: resolve sparse-directory/file conflicts
5e96df4 t1092: test merge conflicts outside cone
defab1b add: allow operating on a sparse-only index
9fc4313 pathspec: stop calling ensure_full_index
0ec03ab add: ignore outside the sparse-checkout in refresh()
adf5b15 add: remove ensure_full_index() with --renormalize
```

These commits are equivalent to those already in `next` via gitgitgadget#999.

```
80b8d6c Merge branch 'sparse-index/add' into stolee/sparse-index/add
```

This merge resolves conflicts with some work that happened in parallel, but is already in upstream `master`.

```
c407b2c t7519: rewrite sparse index test
9dad0d2 sparse-index: silently return when not using cone-mode patterns
2974920 sparse-index: silently return when cache tree fails
e7cdaa0 unpack-trees: fix nested sparse-dir search
347410c sparse-checkout: create helper methods
4537233 attr: be careful about sparse directories
5282a86 sparse-index: add SPARSE_INDEX_MEMORY_ONLY flag
3a2f316 sparse-checkout: clear tracked sparse dirs
fb47b56 sparse-checkout: add config to disable deleting dirs
```

These commits are the ones under review as of gitgitgadget#1009. Recent review made this less stable. It's a slightly different and more robust version of git#396.

> Note: I'm still not done with the feedback for upstream, but the remaining feedback is "can we add tests that cover these tricky technical bits?" and in `microsoft/git` these are already covered by the Scalar functional tests (since that's how they were found).

```
080b02c diff: ignore sparse paths in diffstat
d91a647 merge: make sparse-aware with ORT
df49b5f merge-ort: expand only for out-of-cone conflicts
cdecb85 t1092: add cherry-pick, rebase tests
0c1ecfb sequencer: ensure full index if not ORT strategy
406dfbe sparse-index: integrate with cherry-pick and rebase
```

These commits integrate with `git merge`, `git cherry-pick`, `git revert`, and `git rebase` as of gitgitgadget#1019. This got some feedback that changed how the tests were working so they are more robust. This led to a new commit (0c1ecfb).

```
cbb0ab3 Merge branch 'sparse-index/merge' into vfs-2.33.0
acb8623 t7524: test no longer fails
```

Finally, the commits are merged into `vfs-2.33.0` and also we include a fix to a `microsoft/git` test that is no longer broken.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Sep 30, 2022
This branch is exactly git#410, but with one more commit: enabling the sparse index by default in d59110a.

Having this in the `vfs-2.33.0` branch helps build confidence that the sparse index is doing what it should be doing by running in the Scalar functional tests and in our test branches.

If we want to cut a new `microsoft/git` release without enabling the sparse index, we can simply revert this commit.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Sep 30, 2022
One thing I forgot when talking about the sparse index is that we have a performance test: `t/perf/p2000-sparse-operations.sh`. This test wasn't helpful for commands like `git merge` that need a particular set of input, but work for more read-only operations.

Here is a quick demonstration of how this performance test works so we could have a definitive measure of how your previous updates improved performance. 

To get these results, I ran the following command in `t/perf`:

```
 ./run 4bcd533 f9255a5 f28fc01 b713582 -- p2000-sparse-operations.sh
```

The short-shas correspond to the merge commits for these PRs:

* git#410 
* git#421 
* git#417 
* git#419

The test takes a copy of the Git repository and creates several copies within a nested directory heirarchy.


```
Test                                                   4bcd533       f9255a5              f28fc01              b713582           
-------------------------------------------------------------------------------------------------------------------------------------------------
2000.2: git status (full-v3)                           0.19(0.15+0.05)   0.19(0.16+0.05) +0.0%    0.20(0.18+0.03) +5.3%    0.19(0.17+0.04) +0.0% 
2000.3: git status (full-v4)                           0.20(0.18+0.04)   0.19(0.15+0.06) -5.0%    0.21(0.18+0.05) +5.0%    0.18(0.18+0.02) -10.0%
2000.4: git status (sparse-v3)                         0.04(0.04+0.04)   0.05(0.07+0.04) +25.0%   0.04(0.04+0.05) +0.0%    0.04(0.06+0.04) +0.0% 
2000.5: git status (sparse-v4)                         0.04(0.03+0.06)   0.04(0.05+0.05) +0.0%    0.05(0.05+0.04) +25.0%   0.05(0.06+0.04) +25.0%
2000.6: git add -A (full-v3)                           0.36(0.29+0.05)   0.38(0.28+0.07) +5.6%    0.36(0.31+0.05) +0.0%    0.37(0.31+0.05) +2.8% 
2000.7: git add -A (full-v4)                           0.34(0.27+0.06)   0.34(0.29+0.05) +0.0%    0.34(0.29+0.04) +0.0%    0.35(0.28+0.06) +2.9% 
2000.8: git add -A (sparse-v3)                         0.06(0.07+0.04)   0.06(0.05+0.06) +0.0%    0.06(0.09+0.01) +0.0%    0.06(0.08+0.03) +0.0% 
2000.9: git add -A (sparse-v4)                         0.05(0.05+0.04)   0.05(0.05+0.07) +0.0%    0.05(0.04+0.06) +0.0%    0.06(0.06+0.05) +20.0%
2000.10: git add . (full-v3)                           0.38(0.31+0.05)   0.37(0.29+0.06) -2.6%    0.37(0.30+0.07) -2.6%    0.37(0.29+0.06) -2.6% 
2000.11: git add . (full-v4)                           0.35(0.31+0.04)   0.35(0.29+0.07) +0.0%    0.35(0.29+0.05) +0.0%    0.34(0.29+0.06) -2.9% 
2000.12: git add . (sparse-v3)                         0.06(0.06+0.05)   0.06(0.05+0.06) +0.0%    0.06(0.07+0.05) +0.0%    0.06(0.09+0.03) +0.0% 
2000.13: git add . (sparse-v4)                         0.06(0.06+0.06)   0.06(0.07+0.04) +0.0%    0.05(0.06+0.05) -16.7%   0.05(0.05+0.07) -16.7%
2000.14: git commit -a -m A (full-v3)                  0.48(0.37+0.08)   0.45(0.36+0.08) -6.2%    0.45(0.35+0.09) -6.2%    0.44(0.36+0.07) -8.3% 
2000.15: git commit -a -m A (full-v4)                  0.45(0.40+0.06)   0.43(0.34+0.07) -4.4%    0.45(0.37+0.06) +0.0%    0.42(0.36+0.05) -6.7% 
2000.16: git commit -a -m A (sparse-v3)                0.05(0.05+0.06)   0.05(0.05+0.03) +0.0%    0.05(0.06+0.06) +0.0%    0.05(0.04+0.06) +0.0% 
2000.17: git commit -a -m A (sparse-v4)                0.05(0.06+0.03)   0.05(0.06+0.04) +0.0%    0.06(0.07+0.05) +20.0%   0.05(0.04+0.06) +0.0% 
2000.18: git checkout -f - (full-v3)                   0.55(0.43+0.08)   0.54(0.46+0.05) -1.8%    0.55(0.46+0.07) +0.0%    0.54(0.40+0.10) -1.8% 
2000.19: git checkout -f - (full-v4)                   0.55(0.41+0.09)   0.50(0.40+0.09) -9.1%    0.51(0.46+0.05) -7.3%    0.51(0.44+0.06) -7.3% 
2000.20: git checkout -f - (sparse-v3)                 0.06(0.09+0.03)   0.06(0.08+0.03) +0.0%    0.06(0.06+0.05) +0.0%    0.07(0.09+0.03) +16.7%
2000.21: git checkout -f - (sparse-v4)                 0.06(0.08+0.04)   0.05(0.07+0.05) -16.7%   0.05(0.07+0.04) -16.7%   0.06(0.09+0.03) +0.0% 
```

All of the above were already integrated.

```
2000.22: git reset (full-v3)                           0.41(0.32+0.06)   0.40(0.31+0.06) -2.4%    0.41(0.33+0.05) +0.0%    0.42(0.34+0.04) +2.4% 
2000.23: git reset (full-v4)                           0.37(0.32+0.05)   0.35(0.30+0.05) -5.4%    0.37(0.30+0.05) +0.0%    0.35(0.31+0.03) -5.4% 
2000.24: git reset (sparse-v3)                         0.68(0.65+0.05)   0.55(0.52+0.04) -19.1%   0.04(0.05+0.04) -94.1%   0.04(0.05+0.04) -94.1%
2000.25: git reset (sparse-v4)                         0.70(0.65+0.05)   0.54(0.50+0.06) -22.9%   0.04(0.07+0.01) -94.3%   0.03(0.05+0.05) -95.7%
2000.26: git reset --hard (full-v3)                    0.54(0.43+0.07)   0.53(0.43+0.06) -1.9%    0.55(0.46+0.05) +1.9%    0.55(0.44+0.06) +1.9% 
2000.27: git reset --hard (full-v4)                    0.50(0.45+0.03)   0.50(0.43+0.05) +0.0%    0.49(0.41+0.06) -2.0%    0.50(0.42+0.05) +0.0% 
2000.28: git reset --hard (sparse-v3)                  0.83(0.76+0.06)   0.68(0.62+0.05) -18.1%   0.07(0.05+0.02) -91.6%   0.07(0.05+0.02) -91.6%
2000.29: git reset --hard (sparse-v4)                  0.80(0.75+0.05)   0.69(0.62+0.06) -13.8%   0.07(0.04+0.02) -91.2%   0.07(0.04+0.03) -91.2%
```

As expected, `git reset [--hard]` improves with the sparse index integration, but remains constant across the full index case.

```
2000.30: git update-index --add --remove (full-v3)     0.03(0.01+0.01)   0.03(0.02+0.01) +0.0%    0.03(0.02+0.01) +0.0%    0.03(0.01+0.01) +0.0% 
2000.31: git update-index --add --remove (full-v4)     0.03(0.02+0.01)   0.03(0.02+0.01) +0.0%    0.03(0.03+0.00) +0.0%    0.03(0.02+0.01) +0.0% 
2000.32: git update-index --add --remove (sparse-v3)   0.57(0.54+0.02)   0.43(0.42+0.00) -24.6%   0.44(0.41+0.03) -22.8%   0.44(0.42+0.01) -22.8%
2000.33: git update-index --add --remove (sparse-v4)   0.56(0.52+0.04)   0.43(0.42+0.01) -23.2%   0.44(0.42+0.02) -21.4%   0.42(0.41+0.01) -25.0%
```

These do not change significantly because git#423 is not merged.

```
2000.34: git diff (full-v3)                            0.07(0.05+0.03)   0.06(0.05+0.03) -14.3%   0.07(0.05+0.03) +0.0%    0.06(0.05+0.03) -14.3%
2000.35: git diff (full-v4)                            0.06(0.05+0.03)   0.06(0.05+0.02) +0.0%    0.06(0.05+0.02) +0.0%    0.06(0.06+0.02) +0.0% 
2000.36: git diff (sparse-v3)                          0.25(0.23+0.03)   0.17(0.17+0.02) -32.0%   0.18(0.18+0.02) -28.0%   0.01(0.03+0.03) -96.0%
2000.37: git diff (sparse-v4)                          0.25(0.22+0.05)   0.16(0.16+0.01) -36.0%   0.18(0.15+0.04) -28.0%   0.01(0.04+0.02) -96.0%
2000.38: git diff --staged (full-v3)                   0.03(0.01+0.01)   0.03(0.02+0.01) +0.0%    0.03(0.02+0.01) +0.0%    0.03(0.02+0.00) +0.0% 
2000.39: git diff --staged (full-v4)                   0.04(0.03+0.01)   0.03(0.02+0.01) -25.0%   0.03(0.03+0.00) -25.0%   0.03(0.03+0.00) -25.0%
2000.40: git diff --staged (sparse-v3)                 0.21(0.19+0.01)   0.15(0.13+0.01) -28.6%   0.15(0.14+0.01) -28.6%   0.01(0.01+0.00) -95.2%
2000.41: git diff --staged (sparse-v4)                 0.22(0.21+0.01)   0.14(0.11+0.03) -36.4%   0.15(0.13+0.02) -31.8%   0.01(0.01+0.00) -95.5%
```

The `git diff` improvements are measurable.

```
2000.42: git sparse-checkout reapply (full-v3)         0.63(0.54+0.05)   0.56(0.48+0.04) -11.1%   0.57(0.48+0.03) -9.5%    0.59(0.48+0.05) -6.3% 
2000.43: git sparse-checkout reapply (full-v4)         0.60(0.54+0.02)   0.51(0.46+0.03) -15.0%   0.54(0.48+0.02) -10.0%   0.50(0.44+0.04) -16.7%
2000.44: git sparse-checkout reapply (sparse-v3)       0.91(0.86+0.05)   0.05(0.05+0.00) -94.5%   0.06(0.05+0.01) -93.4%   0.06(0.06+0.00) -93.4%
2000.45: git sparse-checkout reapply (sparse-v4)       0.92(0.88+0.04)   0.05(0.05+0.00) -94.6%   0.05(0.05+0.01) -94.6%   0.05(0.04+0.01) -94.6%
```

Finally, the `git sparse-checkout` measurements are also present.

This test script is particularly valuable when contributing changes upstream. It can be good to start by adding the lines to the performance test in an early commit, then demonstrating the performance change by copying the necessary lines from the output table into your commit message.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Oct 4, 2022
```
6e74958 p2000: add 'git checkout -' test and decrease depth
3e1d03c p2000: compress repo names
cd94f82 commit: integrate with sparse-index
65e79b8 sparse-index: recompute cache-tree
e9a9981 checkout: stop expanding sparse indexes
4b801c8 t1092: document bad 'git checkout' behavior
71e3015 unpack-trees: resolve sparse-directory/file conflicts
5e96df4 t1092: test merge conflicts outside cone
defab1b add: allow operating on a sparse-only index
9fc4313 pathspec: stop calling ensure_full_index
0ec03ab add: ignore outside the sparse-checkout in refresh()
adf5b15 add: remove ensure_full_index() with --renormalize
```

These commits are equivalent to those already in `next` via gitgitgadget#999.

```
80b8d6c Merge branch 'sparse-index/add' into stolee/sparse-index/add
```

This merge resolves conflicts with some work that happened in parallel, but is already in upstream `master`.

```
c407b2c t7519: rewrite sparse index test
9dad0d2 sparse-index: silently return when not using cone-mode patterns
2974920 sparse-index: silently return when cache tree fails
e7cdaa0 unpack-trees: fix nested sparse-dir search
347410c sparse-checkout: create helper methods
4537233 attr: be careful about sparse directories
5282a86 sparse-index: add SPARSE_INDEX_MEMORY_ONLY flag
3a2f316 sparse-checkout: clear tracked sparse dirs
fb47b56 sparse-checkout: add config to disable deleting dirs
```

These commits are the ones under review as of gitgitgadget#1009. Recent review made this less stable. It's a slightly different and more robust version of git#396.

> Note: I'm still not done with the feedback for upstream, but the remaining feedback is "can we add tests that cover these tricky technical bits?" and in `microsoft/git` these are already covered by the Scalar functional tests (since that's how they were found).

```
080b02c diff: ignore sparse paths in diffstat
d91a647 merge: make sparse-aware with ORT
df49b5f merge-ort: expand only for out-of-cone conflicts
cdecb85 t1092: add cherry-pick, rebase tests
0c1ecfb sequencer: ensure full index if not ORT strategy
406dfbe sparse-index: integrate with cherry-pick and rebase
```

These commits integrate with `git merge`, `git cherry-pick`, `git revert`, and `git rebase` as of gitgitgadget#1019. This got some feedback that changed how the tests were working so they are more robust. This led to a new commit (0c1ecfb).

```
cbb0ab3 Merge branch 'sparse-index/merge' into vfs-2.33.0
acb8623 t7524: test no longer fails
```

Finally, the commits are merged into `vfs-2.33.0` and also we include a fix to a `microsoft/git` test that is no longer broken.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Oct 4, 2022
This branch is exactly git#410, but with one more commit: enabling the sparse index by default in d59110a.

Having this in the `vfs-2.33.0` branch helps build confidence that the sparse index is doing what it should be doing by running in the Scalar functional tests and in our test branches.

If we want to cut a new `microsoft/git` release without enabling the sparse index, we can simply revert this commit.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Nov 8, 2022
```
6e74958 p2000: add 'git checkout -' test and decrease depth
3e1d03c p2000: compress repo names
cd94f82 commit: integrate with sparse-index
65e79b8 sparse-index: recompute cache-tree
e9a9981 checkout: stop expanding sparse indexes
4b801c8 t1092: document bad 'git checkout' behavior
71e3015 unpack-trees: resolve sparse-directory/file conflicts
5e96df4 t1092: test merge conflicts outside cone
defab1b add: allow operating on a sparse-only index
9fc4313 pathspec: stop calling ensure_full_index
0ec03ab add: ignore outside the sparse-checkout in refresh()
adf5b15 add: remove ensure_full_index() with --renormalize
```

These commits are equivalent to those already in `next` via gitgitgadget#999.

```
80b8d6c Merge branch 'sparse-index/add' into stolee/sparse-index/add
```

This merge resolves conflicts with some work that happened in parallel, but is already in upstream `master`.

```
c407b2c t7519: rewrite sparse index test
9dad0d2 sparse-index: silently return when not using cone-mode patterns
2974920 sparse-index: silently return when cache tree fails
e7cdaa0 unpack-trees: fix nested sparse-dir search
347410c sparse-checkout: create helper methods
4537233 attr: be careful about sparse directories
5282a86 sparse-index: add SPARSE_INDEX_MEMORY_ONLY flag
3a2f316 sparse-checkout: clear tracked sparse dirs
fb47b56 sparse-checkout: add config to disable deleting dirs
```

These commits are the ones under review as of gitgitgadget#1009. Recent review made this less stable. It's a slightly different and more robust version of git#396.

> Note: I'm still not done with the feedback for upstream, but the remaining feedback is "can we add tests that cover these tricky technical bits?" and in `microsoft/git` these are already covered by the Scalar functional tests (since that's how they were found).

```
080b02c diff: ignore sparse paths in diffstat
d91a647 merge: make sparse-aware with ORT
df49b5f merge-ort: expand only for out-of-cone conflicts
cdecb85 t1092: add cherry-pick, rebase tests
0c1ecfb sequencer: ensure full index if not ORT strategy
406dfbe sparse-index: integrate with cherry-pick and rebase
```

These commits integrate with `git merge`, `git cherry-pick`, `git revert`, and `git rebase` as of gitgitgadget#1019. This got some feedback that changed how the tests were working so they are more robust. This led to a new commit (0c1ecfb).

```
cbb0ab3 Merge branch 'sparse-index/merge' into vfs-2.33.0
acb8623 t7524: test no longer fails
```

Finally, the commits are merged into `vfs-2.33.0` and also we include a fix to a `microsoft/git` test that is no longer broken.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Nov 8, 2022
This branch is exactly git#410, but with one more commit: enabling the sparse index by default in d59110a.

Having this in the `vfs-2.33.0` branch helps build confidence that the sparse index is doing what it should be doing by running in the Scalar functional tests and in our test branches.

If we want to cut a new `microsoft/git` release without enabling the sparse index, we can simply revert this commit.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Mar 15, 2023
```
6e74958 p2000: add 'git checkout -' test and decrease depth
3e1d03c p2000: compress repo names
cd94f82 commit: integrate with sparse-index
65e79b8 sparse-index: recompute cache-tree
e9a9981 checkout: stop expanding sparse indexes
4b801c8 t1092: document bad 'git checkout' behavior
71e3015 unpack-trees: resolve sparse-directory/file conflicts
5e96df4 t1092: test merge conflicts outside cone
defab1b add: allow operating on a sparse-only index
9fc4313 pathspec: stop calling ensure_full_index
0ec03ab add: ignore outside the sparse-checkout in refresh()
adf5b15 add: remove ensure_full_index() with --renormalize
```

These commits are equivalent to those already in `next` via gitgitgadget#999.

```
80b8d6c Merge branch 'sparse-index/add' into stolee/sparse-index/add
```

This merge resolves conflicts with some work that happened in parallel, but is already in upstream `master`.

```
c407b2c t7519: rewrite sparse index test
9dad0d2 sparse-index: silently return when not using cone-mode patterns
2974920 sparse-index: silently return when cache tree fails
e7cdaa0 unpack-trees: fix nested sparse-dir search
347410c sparse-checkout: create helper methods
4537233 attr: be careful about sparse directories
5282a86 sparse-index: add SPARSE_INDEX_MEMORY_ONLY flag
3a2f316 sparse-checkout: clear tracked sparse dirs
fb47b56 sparse-checkout: add config to disable deleting dirs
```

These commits are the ones under review as of gitgitgadget#1009. Recent review made this less stable. It's a slightly different and more robust version of git#396.

> Note: I'm still not done with the feedback for upstream, but the remaining feedback is "can we add tests that cover these tricky technical bits?" and in `microsoft/git` these are already covered by the Scalar functional tests (since that's how they were found).

```
080b02c diff: ignore sparse paths in diffstat
d91a647 merge: make sparse-aware with ORT
df49b5f merge-ort: expand only for out-of-cone conflicts
cdecb85 t1092: add cherry-pick, rebase tests
0c1ecfb sequencer: ensure full index if not ORT strategy
406dfbe sparse-index: integrate with cherry-pick and rebase
```

These commits integrate with `git merge`, `git cherry-pick`, `git revert`, and `git rebase` as of gitgitgadget#1019. This got some feedback that changed how the tests were working so they are more robust. This led to a new commit (0c1ecfb).

```
cbb0ab3 Merge branch 'sparse-index/merge' into vfs-2.33.0
acb8623 t7524: test no longer fails
```

Finally, the commits are merged into `vfs-2.33.0` and also we include a fix to a `microsoft/git` test that is no longer broken.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Mar 15, 2023
This branch is exactly git#410, but with one more commit: enabling the sparse index by default in d59110a.

Having this in the `vfs-2.33.0` branch helps build confidence that the sparse index is doing what it should be doing by running in the Scalar functional tests and in our test branches.

If we want to cut a new `microsoft/git` release without enabling the sparse index, we can simply revert this commit.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Mar 15, 2023
```
6e74958 p2000: add 'git checkout -' test and decrease depth
3e1d03c p2000: compress repo names
cd94f82 commit: integrate with sparse-index
65e79b8 sparse-index: recompute cache-tree
e9a9981 checkout: stop expanding sparse indexes
4b801c8 t1092: document bad 'git checkout' behavior
71e3015 unpack-trees: resolve sparse-directory/file conflicts
5e96df4 t1092: test merge conflicts outside cone
defab1b add: allow operating on a sparse-only index
9fc4313 pathspec: stop calling ensure_full_index
0ec03ab add: ignore outside the sparse-checkout in refresh()
adf5b15 add: remove ensure_full_index() with --renormalize
```

These commits are equivalent to those already in `next` via gitgitgadget#999.

```
80b8d6c Merge branch 'sparse-index/add' into stolee/sparse-index/add
```

This merge resolves conflicts with some work that happened in parallel, but is already in upstream `master`.

```
c407b2c t7519: rewrite sparse index test
9dad0d2 sparse-index: silently return when not using cone-mode patterns
2974920 sparse-index: silently return when cache tree fails
e7cdaa0 unpack-trees: fix nested sparse-dir search
347410c sparse-checkout: create helper methods
4537233 attr: be careful about sparse directories
5282a86 sparse-index: add SPARSE_INDEX_MEMORY_ONLY flag
3a2f316 sparse-checkout: clear tracked sparse dirs
fb47b56 sparse-checkout: add config to disable deleting dirs
```

These commits are the ones under review as of gitgitgadget#1009. Recent review made this less stable. It's a slightly different and more robust version of git#396.

> Note: I'm still not done with the feedback for upstream, but the remaining feedback is "can we add tests that cover these tricky technical bits?" and in `microsoft/git` these are already covered by the Scalar functional tests (since that's how they were found).

```
080b02c diff: ignore sparse paths in diffstat
d91a647 merge: make sparse-aware with ORT
df49b5f merge-ort: expand only for out-of-cone conflicts
cdecb85 t1092: add cherry-pick, rebase tests
0c1ecfb sequencer: ensure full index if not ORT strategy
406dfbe sparse-index: integrate with cherry-pick and rebase
```

These commits integrate with `git merge`, `git cherry-pick`, `git revert`, and `git rebase` as of gitgitgadget#1019. This got some feedback that changed how the tests were working so they are more robust. This led to a new commit (0c1ecfb).

```
cbb0ab3 Merge branch 'sparse-index/merge' into vfs-2.33.0
acb8623 t7524: test no longer fails
```

Finally, the commits are merged into `vfs-2.33.0` and also we include a fix to a `microsoft/git` test that is no longer broken.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Mar 15, 2023
This branch is exactly git#410, but with one more commit: enabling the sparse index by default in d59110a.

Having this in the `vfs-2.33.0` branch helps build confidence that the sparse index is doing what it should be doing by running in the Scalar functional tests and in our test branches.

If we want to cut a new `microsoft/git` release without enabling the sparse index, we can simply revert this commit.
derrickstolee added a commit to derrickstolee/git that referenced this pull request May 11, 2023
```
6e74958 p2000: add 'git checkout -' test and decrease depth
3e1d03c p2000: compress repo names
cd94f82 commit: integrate with sparse-index
65e79b8 sparse-index: recompute cache-tree
e9a9981 checkout: stop expanding sparse indexes
4b801c8 t1092: document bad 'git checkout' behavior
71e3015 unpack-trees: resolve sparse-directory/file conflicts
5e96df4 t1092: test merge conflicts outside cone
defab1b add: allow operating on a sparse-only index
9fc4313 pathspec: stop calling ensure_full_index
0ec03ab add: ignore outside the sparse-checkout in refresh()
adf5b15 add: remove ensure_full_index() with --renormalize
```

These commits are equivalent to those already in `next` via gitgitgadget#999.

```
80b8d6c Merge branch 'sparse-index/add' into stolee/sparse-index/add
```

This merge resolves conflicts with some work that happened in parallel, but is already in upstream `master`.

```
c407b2c t7519: rewrite sparse index test
9dad0d2 sparse-index: silently return when not using cone-mode patterns
2974920 sparse-index: silently return when cache tree fails
e7cdaa0 unpack-trees: fix nested sparse-dir search
347410c sparse-checkout: create helper methods
4537233 attr: be careful about sparse directories
5282a86 sparse-index: add SPARSE_INDEX_MEMORY_ONLY flag
3a2f316 sparse-checkout: clear tracked sparse dirs
fb47b56 sparse-checkout: add config to disable deleting dirs
```

These commits are the ones under review as of gitgitgadget#1009. Recent review made this less stable. It's a slightly different and more robust version of git#396.

> Note: I'm still not done with the feedback for upstream, but the remaining feedback is "can we add tests that cover these tricky technical bits?" and in `microsoft/git` these are already covered by the Scalar functional tests (since that's how they were found).

```
080b02c diff: ignore sparse paths in diffstat
d91a647 merge: make sparse-aware with ORT
df49b5f merge-ort: expand only for out-of-cone conflicts
cdecb85 t1092: add cherry-pick, rebase tests
0c1ecfb sequencer: ensure full index if not ORT strategy
406dfbe sparse-index: integrate with cherry-pick and rebase
```

These commits integrate with `git merge`, `git cherry-pick`, `git revert`, and `git rebase` as of gitgitgadget#1019. This got some feedback that changed how the tests were working so they are more robust. This led to a new commit (0c1ecfb).

```
cbb0ab3 Merge branch 'sparse-index/merge' into vfs-2.33.0
acb8623 t7524: test no longer fails
```

Finally, the commits are merged into `vfs-2.33.0` and also we include a fix to a `microsoft/git` test that is no longer broken.
derrickstolee added a commit to derrickstolee/git that referenced this pull request May 11, 2023
This branch is exactly git#410, but with one more commit: enabling the sparse index by default in d59110a.

Having this in the `vfs-2.33.0` branch helps build confidence that the sparse index is doing what it should be doing by running in the Scalar functional tests and in our test branches.

If we want to cut a new `microsoft/git` release without enabling the sparse index, we can simply revert this commit.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Aug 23, 2023
```
6e74958 p2000: add 'git checkout -' test and decrease depth
3e1d03c p2000: compress repo names
cd94f82 commit: integrate with sparse-index
65e79b8 sparse-index: recompute cache-tree
e9a9981 checkout: stop expanding sparse indexes
4b801c8 t1092: document bad 'git checkout' behavior
71e3015 unpack-trees: resolve sparse-directory/file conflicts
5e96df4 t1092: test merge conflicts outside cone
defab1b add: allow operating on a sparse-only index
9fc4313 pathspec: stop calling ensure_full_index
0ec03ab add: ignore outside the sparse-checkout in refresh()
adf5b15 add: remove ensure_full_index() with --renormalize
```

These commits are equivalent to those already in `next` via gitgitgadget#999.

```
80b8d6c Merge branch 'sparse-index/add' into stolee/sparse-index/add
```

This merge resolves conflicts with some work that happened in parallel, but is already in upstream `master`.

```
c407b2c t7519: rewrite sparse index test
9dad0d2 sparse-index: silently return when not using cone-mode patterns
2974920 sparse-index: silently return when cache tree fails
e7cdaa0 unpack-trees: fix nested sparse-dir search
347410c sparse-checkout: create helper methods
4537233 attr: be careful about sparse directories
5282a86 sparse-index: add SPARSE_INDEX_MEMORY_ONLY flag
3a2f316 sparse-checkout: clear tracked sparse dirs
fb47b56 sparse-checkout: add config to disable deleting dirs
```

These commits are the ones under review as of gitgitgadget#1009. Recent review made this less stable. It's a slightly different and more robust version of git#396.

> Note: I'm still not done with the feedback for upstream, but the remaining feedback is "can we add tests that cover these tricky technical bits?" and in `microsoft/git` these are already covered by the Scalar functional tests (since that's how they were found).

```
080b02c diff: ignore sparse paths in diffstat
d91a647 merge: make sparse-aware with ORT
df49b5f merge-ort: expand only for out-of-cone conflicts
cdecb85 t1092: add cherry-pick, rebase tests
0c1ecfb sequencer: ensure full index if not ORT strategy
406dfbe sparse-index: integrate with cherry-pick and rebase
```

These commits integrate with `git merge`, `git cherry-pick`, `git revert`, and `git rebase` as of gitgitgadget#1019. This got some feedback that changed how the tests were working so they are more robust. This led to a new commit (0c1ecfb).

```
cbb0ab3 Merge branch 'sparse-index/merge' into vfs-2.33.0
acb8623 t7524: test no longer fails
```

Finally, the commits are merged into `vfs-2.33.0` and also we include a fix to a `microsoft/git` test that is no longer broken.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Aug 23, 2023
This branch is exactly git#410, but with one more commit: enabling the sparse index by default in d59110a.

Having this in the `vfs-2.33.0` branch helps build confidence that the sparse index is doing what it should be doing by running in the Scalar functional tests and in our test branches.

If we want to cut a new `microsoft/git` release without enabling the sparse index, we can simply revert this commit.
vdye pushed a commit to vdye/git that referenced this pull request Jan 9, 2024
```
6e74958 p2000: add 'git checkout -' test and decrease depth
3e1d03c p2000: compress repo names
cd94f82 commit: integrate with sparse-index
65e79b8 sparse-index: recompute cache-tree
e9a9981 checkout: stop expanding sparse indexes
4b801c8 t1092: document bad 'git checkout' behavior
71e3015 unpack-trees: resolve sparse-directory/file conflicts
5e96df4 t1092: test merge conflicts outside cone
defab1b add: allow operating on a sparse-only index
9fc4313 pathspec: stop calling ensure_full_index
0ec03ab add: ignore outside the sparse-checkout in refresh()
adf5b15 add: remove ensure_full_index() with --renormalize
```

These commits are equivalent to those already in `next` via gitgitgadget#999.

```
80b8d6c Merge branch 'sparse-index/add' into stolee/sparse-index/add
```

This merge resolves conflicts with some work that happened in parallel, but is already in upstream `master`.

```
c407b2c t7519: rewrite sparse index test
9dad0d2 sparse-index: silently return when not using cone-mode patterns
2974920 sparse-index: silently return when cache tree fails
e7cdaa0 unpack-trees: fix nested sparse-dir search
347410c sparse-checkout: create helper methods
4537233 attr: be careful about sparse directories
5282a86 sparse-index: add SPARSE_INDEX_MEMORY_ONLY flag
3a2f316 sparse-checkout: clear tracked sparse dirs
fb47b56 sparse-checkout: add config to disable deleting dirs
```

These commits are the ones under review as of gitgitgadget#1009. Recent review made this less stable. It's a slightly different and more robust version of git#396.

> Note: I'm still not done with the feedback for upstream, but the remaining feedback is "can we add tests that cover these tricky technical bits?" and in `microsoft/git` these are already covered by the Scalar functional tests (since that's how they were found).

```
080b02c diff: ignore sparse paths in diffstat
d91a647 merge: make sparse-aware with ORT
df49b5f merge-ort: expand only for out-of-cone conflicts
cdecb85 t1092: add cherry-pick, rebase tests
0c1ecfb sequencer: ensure full index if not ORT strategy
406dfbe sparse-index: integrate with cherry-pick and rebase
```

These commits integrate with `git merge`, `git cherry-pick`, `git revert`, and `git rebase` as of gitgitgadget#1019. This got some feedback that changed how the tests were working so they are more robust. This led to a new commit (0c1ecfb).

```
cbb0ab3 Merge branch 'sparse-index/merge' into vfs-2.33.0
acb8623 t7524: test no longer fails
```

Finally, the commits are merged into `vfs-2.33.0` and also we include a fix to a `microsoft/git` test that is no longer broken.
vdye pushed a commit to vdye/git that referenced this pull request Jan 9, 2024
This branch is exactly git#410, but with one more commit: enabling the sparse index by default in d59110a.

Having this in the `vfs-2.33.0` branch helps build confidence that the sparse index is doing what it should be doing by running in the Scalar functional tests and in our test branches.

If we want to cut a new `microsoft/git` release without enabling the sparse index, we can simply revert this commit.
vdye pushed a commit to vdye/git that referenced this pull request Jan 9, 2024
```
6e74958 p2000: add 'git checkout -' test and decrease depth
3e1d03c p2000: compress repo names
cd94f82 commit: integrate with sparse-index
65e79b8 sparse-index: recompute cache-tree
e9a9981 checkout: stop expanding sparse indexes
4b801c8 t1092: document bad 'git checkout' behavior
71e3015 unpack-trees: resolve sparse-directory/file conflicts
5e96df4 t1092: test merge conflicts outside cone
defab1b add: allow operating on a sparse-only index
9fc4313 pathspec: stop calling ensure_full_index
0ec03ab add: ignore outside the sparse-checkout in refresh()
adf5b15 add: remove ensure_full_index() with --renormalize
```

These commits are equivalent to those already in `next` via gitgitgadget#999.

```
80b8d6c Merge branch 'sparse-index/add' into stolee/sparse-index/add
```

This merge resolves conflicts with some work that happened in parallel, but is already in upstream `master`.

```
c407b2c t7519: rewrite sparse index test
9dad0d2 sparse-index: silently return when not using cone-mode patterns
2974920 sparse-index: silently return when cache tree fails
e7cdaa0 unpack-trees: fix nested sparse-dir search
347410c sparse-checkout: create helper methods
4537233 attr: be careful about sparse directories
5282a86 sparse-index: add SPARSE_INDEX_MEMORY_ONLY flag
3a2f316 sparse-checkout: clear tracked sparse dirs
fb47b56 sparse-checkout: add config to disable deleting dirs
```

These commits are the ones under review as of gitgitgadget#1009. Recent review made this less stable. It's a slightly different and more robust version of git#396.

> Note: I'm still not done with the feedback for upstream, but the remaining feedback is "can we add tests that cover these tricky technical bits?" and in `microsoft/git` these are already covered by the Scalar functional tests (since that's how they were found).

```
080b02c diff: ignore sparse paths in diffstat
d91a647 merge: make sparse-aware with ORT
df49b5f merge-ort: expand only for out-of-cone conflicts
cdecb85 t1092: add cherry-pick, rebase tests
0c1ecfb sequencer: ensure full index if not ORT strategy
406dfbe sparse-index: integrate with cherry-pick and rebase
```

These commits integrate with `git merge`, `git cherry-pick`, `git revert`, and `git rebase` as of gitgitgadget#1019. This got some feedback that changed how the tests were working so they are more robust. This led to a new commit (0c1ecfb).

```
cbb0ab3 Merge branch 'sparse-index/merge' into vfs-2.33.0
acb8623 t7524: test no longer fails
```

Finally, the commits are merged into `vfs-2.33.0` and also we include a fix to a `microsoft/git` test that is no longer broken.
vdye pushed a commit to vdye/git that referenced this pull request Jan 9, 2024
This branch is exactly git#410, but with one more commit: enabling the sparse index by default in d59110a.

Having this in the `vfs-2.33.0` branch helps build confidence that the sparse index is doing what it should be doing by running in the Scalar functional tests and in our test branches.

If we want to cut a new `microsoft/git` release without enabling the sparse index, we can simply revert this commit.
vdye pushed a commit to vdye/git that referenced this pull request Jan 9, 2024
```
6e74958 p2000: add 'git checkout -' test and decrease depth
3e1d03c p2000: compress repo names
cd94f82 commit: integrate with sparse-index
65e79b8 sparse-index: recompute cache-tree
e9a9981 checkout: stop expanding sparse indexes
4b801c8 t1092: document bad 'git checkout' behavior
71e3015 unpack-trees: resolve sparse-directory/file conflicts
5e96df4 t1092: test merge conflicts outside cone
defab1b add: allow operating on a sparse-only index
9fc4313 pathspec: stop calling ensure_full_index
0ec03ab add: ignore outside the sparse-checkout in refresh()
adf5b15 add: remove ensure_full_index() with --renormalize
```

These commits are equivalent to those already in `next` via gitgitgadget#999.

```
80b8d6c Merge branch 'sparse-index/add' into stolee/sparse-index/add
```

This merge resolves conflicts with some work that happened in parallel, but is already in upstream `master`.

```
c407b2c t7519: rewrite sparse index test
9dad0d2 sparse-index: silently return when not using cone-mode patterns
2974920 sparse-index: silently return when cache tree fails
e7cdaa0 unpack-trees: fix nested sparse-dir search
347410c sparse-checkout: create helper methods
4537233 attr: be careful about sparse directories
5282a86 sparse-index: add SPARSE_INDEX_MEMORY_ONLY flag
3a2f316 sparse-checkout: clear tracked sparse dirs
fb47b56 sparse-checkout: add config to disable deleting dirs
```

These commits are the ones under review as of gitgitgadget#1009. Recent review made this less stable. It's a slightly different and more robust version of git#396.

> Note: I'm still not done with the feedback for upstream, but the remaining feedback is "can we add tests that cover these tricky technical bits?" and in `microsoft/git` these are already covered by the Scalar functional tests (since that's how they were found).

```
080b02c diff: ignore sparse paths in diffstat
d91a647 merge: make sparse-aware with ORT
df49b5f merge-ort: expand only for out-of-cone conflicts
cdecb85 t1092: add cherry-pick, rebase tests
0c1ecfb sequencer: ensure full index if not ORT strategy
406dfbe sparse-index: integrate with cherry-pick and rebase
```

These commits integrate with `git merge`, `git cherry-pick`, `git revert`, and `git rebase` as of gitgitgadget#1019. This got some feedback that changed how the tests were working so they are more robust. This led to a new commit (0c1ecfb).

```
cbb0ab3 Merge branch 'sparse-index/merge' into vfs-2.33.0
acb8623 t7524: test no longer fails
```

Finally, the commits are merged into `vfs-2.33.0` and also we include a fix to a `microsoft/git` test that is no longer broken.
vdye pushed a commit to vdye/git that referenced this pull request Jan 9, 2024
This branch is exactly git#410, but with one more commit: enabling the sparse index by default in d59110a.

Having this in the `vfs-2.33.0` branch helps build confidence that the sparse index is doing what it should be doing by running in the Scalar functional tests and in our test branches.

If we want to cut a new `microsoft/git` release without enabling the sparse index, we can simply revert this commit.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Apr 30, 2024
```
6e74958 p2000: add 'git checkout -' test and decrease depth
3e1d03c p2000: compress repo names
cd94f82 commit: integrate with sparse-index
65e79b8 sparse-index: recompute cache-tree
e9a9981 checkout: stop expanding sparse indexes
4b801c8 t1092: document bad 'git checkout' behavior
71e3015 unpack-trees: resolve sparse-directory/file conflicts
5e96df4 t1092: test merge conflicts outside cone
defab1b add: allow operating on a sparse-only index
9fc4313 pathspec: stop calling ensure_full_index
0ec03ab add: ignore outside the sparse-checkout in refresh()
adf5b15 add: remove ensure_full_index() with --renormalize
```

These commits are equivalent to those already in `next` via gitgitgadget#999.

```
80b8d6c Merge branch 'sparse-index/add' into stolee/sparse-index/add
```

This merge resolves conflicts with some work that happened in parallel, but is already in upstream `master`.

```
c407b2c t7519: rewrite sparse index test
9dad0d2 sparse-index: silently return when not using cone-mode patterns
2974920 sparse-index: silently return when cache tree fails
e7cdaa0 unpack-trees: fix nested sparse-dir search
347410c sparse-checkout: create helper methods
4537233 attr: be careful about sparse directories
5282a86 sparse-index: add SPARSE_INDEX_MEMORY_ONLY flag
3a2f316 sparse-checkout: clear tracked sparse dirs
fb47b56 sparse-checkout: add config to disable deleting dirs
```

These commits are the ones under review as of gitgitgadget#1009. Recent review made this less stable. It's a slightly different and more robust version of git#396.

> Note: I'm still not done with the feedback for upstream, but the remaining feedback is "can we add tests that cover these tricky technical bits?" and in `microsoft/git` these are already covered by the Scalar functional tests (since that's how they were found).

```
080b02c diff: ignore sparse paths in diffstat
d91a647 merge: make sparse-aware with ORT
df49b5f merge-ort: expand only for out-of-cone conflicts
cdecb85 t1092: add cherry-pick, rebase tests
0c1ecfb sequencer: ensure full index if not ORT strategy
406dfbe sparse-index: integrate with cherry-pick and rebase
```

These commits integrate with `git merge`, `git cherry-pick`, `git revert`, and `git rebase` as of gitgitgadget#1019. This got some feedback that changed how the tests were working so they are more robust. This led to a new commit (0c1ecfb).

```
cbb0ab3 Merge branch 'sparse-index/merge' into vfs-2.33.0
acb8623 t7524: test no longer fails
```

Finally, the commits are merged into `vfs-2.33.0` and also we include a fix to a `microsoft/git` test that is no longer broken.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Apr 30, 2024
This branch is exactly git#410, but with one more commit: enabling the sparse index by default in d59110a.

Having this in the `vfs-2.33.0` branch helps build confidence that the sparse index is doing what it should be doing by running in the Scalar functional tests and in our test branches.

If we want to cut a new `microsoft/git` release without enabling the sparse index, we can simply revert this commit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants