-
Notifications
You must be signed in to change notification settings - Fork 97
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
Remove sparse index expansions from untracked file stashes #433
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great comments and commit description - made it super easy to follow your work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the subtle point here: this isn't really a performance fix, but allows us to use ensure_not_expanded
on these two commands (which is a valuable way to protect the performance in the future).
After `unpack-trees` processing, the index would only be considered "sparse" if it contains any sparse directories. That condition missed the case where the index contains only files inside the sparse checkout definition. By explicitly checking for that condition and setting `sparse_index` accordingly, later processing to ensure the index "remains" full can be avoided. Signed-off-by: Victoria Dye <vdye@github.com>
When `--sparse` is specified for `checkout-index` but no sparse directory entries exist outside the sparse checkout definition, the index does not need to be expanded. For this case, moving the index expansion into an explicit check for a sparse directory entry prevents unnecessary expansion. Signed-off-by: Victoria Dye <vdye@github.com>
Move the test for `git stash -u` into the `sparse-index is not expanded` test because it no longer expands the index (temporary or otherwise) when all stashed files are in the sparse checkout definition. Signed-off-by: Victoria Dye <vdye@github.com>
Remove sparse index expansions from untracked file stashes
Remove sparse index expansions from untracked file stashes
Remove sparse index expansions from untracked file stashes
Remove sparse index expansions from untracked file stashes
Remove sparse index expansions from untracked file stashes
Remove sparse index expansions from untracked file stashes
Remove sparse index expansions from untracked file stashes
Remove sparse index expansions from untracked file stashes
Remove sparse index expansions from untracked file stashes
Remove sparse index expansions from untracked file stashes
Remove sparse index expansions from untracked file stashes
Remove sparse index expansions from untracked file stashes
Remove sparse index expansions from untracked file stashes
Remove sparse index expansions from untracked file stashes
Remove sparse index expansions from untracked file stashes
Remove sparse index expansions from untracked file stashes
Remove sparse index expansions from untracked file stashes
Remove sparse index expansions from untracked file stashes
Remove sparse index expansions from untracked file stashes
Remove sparse index expansions from untracked file stashes
Remove sparse index expansions from untracked file stashes
Changes
checkout-index --sparse
(it's only needed if a sparse directory is present to expand)unpack_trees
to set the result to "sparse" if it does not meet any conditions that require a full indexstash -u
&stash pop
test out of its own custom test case and intosparse index is not expanded
Performance
Overall, there weren't substantial differences in the performance of
stash
. That's more-or-less expected - the index expansions removed only apply to the "temporary" untracked file indexes, which are substantially smaller than the regular repository index.