forked from git-for-windows/git
-
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
Sparse Index: upstream updates to git reset
#444
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rename and invert value of `is_missing` to `is_in_reset_tree` to make the variable more descriptive of what it represents. Signed-off-by: Victoria Dye <[email protected]>
Good idea to validate things here, too. Thanks! |
Change `update_index_from_diff` to set `skip-worktree` when applicable for new index entries. When `git reset --mixed <tree-ish>` is run, entries in the index with differences between the pre-reset HEAD and reset <tree-ish> are identified and handled with `update_index_from_diff`. For each file, a new cache entry in inserted into the index, created from the <tree-ish> side of the reset (without changing the working tree). However, the newly-created entry must have `skip-worktree` explicitly set in either of the following scenarios: 1. the file is in the current index and has `skip-worktree` set 2. the file is not in the current index but is outside of a defined sparse checkout definition Not setting the `skip-worktree` bit leads to likely-undesirable results for a user. It causes `skip-worktree` settings to disappear on the "diff"-containing files (but *only* the diff-containing files), leading to those files now showing modifications in `git status`. For example, when running `git reset --mixed` in a sparse checkout, some file entries outside of sparse checkout could show up as deleted, despite the user never deleting anything (and not wanting them on-disk anyway). Additionally, add a test to `t7102` to ensure `skip-worktree` is preserved in a basic `git reset --mixed` scenario and update a failure-documenting test from 19a0acc (t1092: test interesting sparse-checkout scenarios, 2021-01-23) with new expected behavior. Helped-by: Junio C Hamano <[email protected]> Signed-off-by: Victoria Dye <[email protected]>
In anticipation of `git reset --hard` being able to use the sparse index without expanding it, replace the command in `sparse-index is expanded and converted back` with `git reset -- folder1/a`. This command will need to expand the index to work properly, even after integrating the rest of `reset` with sparse index. Helped-by: Derrick Stolee <[email protected]> Signed-off-by: Victoria Dye <[email protected]>
Add new tests for `--merge` and `--keep` modes, as well as mixed reset with pathspecs. New performance test cases exercise various execution paths for `reset`. Co-authored-by: Derrick Stolee <[email protected]> Signed-off-by: Derrick Stolee <[email protected]> Signed-off-by: Victoria Dye <[email protected]>
Remove `ensure_full_index` guard on `prime_cache_tree` and update `prime_cache_tree_rec` to correctly reconstruct sparse directory entries in the cache tree. While processing a tree's entries, `prime_cache_tree_rec` must determine whether a directory entry is sparse or not by searching for it in the index (*without* expanding the index). If a matching sparse directory index entry is found, no subtrees are added to the cache tree entry and the entry count is set to 1 (representing the sparse directory itself). Otherwise, the tree is assumed to not be sparse and its subtrees are recursively added to the cache tree. Helped-by: Elijah Newren <[email protected]> Signed-off-by: Victoria Dye <[email protected]>
Remove the `ensure_full_index` guard on `read_from_tree` and update `git reset --mixed` to ensure it can use sparse directory index entries wherever possible. Sparse directory entries are reset use `diff_tree_oid`, which requires `change` and `add_remove` functions to process the internal contents of the sparse directory. The `recursive` diff option handles cases in which `reset --mixed` must diff/merge files that are nested multiple levels deep in a sparse directory. The use of pathspecs with `git reset --mixed` introduces scenarios in which internal contents of sparse directories may be matched by the pathspec. In order to reset *all* files in the repo that may match the pathspec, the following conditions on the pathspec require index expansion before performing the reset: * "magic" pathspecs * wildcard pathspecs that do not match only in-cone files or entire sparse directories * literal pathspecs matching something outside the sparse checkout definition Helped-by: Elijah Newren <[email protected]> Signed-off-by: Victoria Dye <[email protected]>
Update behavior when the `index.sparse` config setting is provided inline to a command. Previously would run command on sparse index (unless otherwise expanded), then write out as sparse. Now, the index will be expanded in the process of reading it in. Co-authored-by: Derrick Stolee <[email protected]> Signed-off-by: Victoria Dye <[email protected]>
derrickstolee
approved these changes
Oct 13, 2021
dscho
pushed a commit
that referenced
this pull request
Oct 30, 2021
Sparse Index: upstream updates to `git reset`
derrickstolee
pushed a commit
that referenced
this pull request
Oct 30, 2021
Sparse Index: upstream updates to `git reset`
derrickstolee
pushed a commit
that referenced
this pull request
Oct 31, 2021
Sparse Index: upstream updates to `git reset`
derrickstolee
pushed a commit
that referenced
this pull request
Nov 4, 2021
Sparse Index: upstream updates to `git reset`
derrickstolee
pushed a commit
that referenced
this pull request
Nov 4, 2021
Sparse Index: upstream updates to `git reset`
derrickstolee
pushed a commit
that referenced
this pull request
Nov 10, 2021
Sparse Index: upstream updates to `git reset`
derrickstolee
pushed a commit
that referenced
this pull request
Nov 15, 2021
Sparse Index: upstream updates to `git reset`
ldennington
pushed a commit
to ldennington/git
that referenced
this pull request
Jan 12, 2022
Sparse Index: upstream updates to `git reset`
ldennington
pushed a commit
to ldennington/git
that referenced
this pull request
Jan 19, 2022
Sparse Index: upstream updates to `git reset`
ldennington
pushed a commit
to ldennington/git
that referenced
this pull request
Jan 20, 2022
Sparse Index: upstream updates to `git reset`
ldennington
pushed a commit
to ldennington/git
that referenced
this pull request
Jan 20, 2022
Sparse Index: upstream updates to `git reset`
ldennington
pushed a commit
to ldennington/git
that referenced
this pull request
Jan 20, 2022
Sparse Index: upstream updates to `git reset`
ldennington
pushed a commit
to ldennington/git
that referenced
this pull request
Jan 20, 2022
Sparse Index: upstream updates to `git reset`
ldennington
pushed a commit
to ldennington/git
that referenced
this pull request
Jan 20, 2022
Sparse Index: upstream updates to `git reset`
ldennington
pushed a commit
to ldennington/git
that referenced
this pull request
Jan 20, 2022
Sparse Index: upstream updates to `git reset`
ldennington
pushed a commit
to ldennington/git
that referenced
this pull request
Jan 25, 2022
Sparse Index: upstream updates to `git reset`
ldennington
pushed a commit
to ldennington/git
that referenced
this pull request
Jan 25, 2022
Sparse Index: upstream updates to `git reset`
dscho
pushed a commit
that referenced
this pull request
Feb 1, 2022
Sparse Index: upstream updates to `git reset`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Based on feedback in this patch series, reflecting the current state (V4). Want to integrate this before the bug bash (although things might change after more upstream review).
Changes
index.sparse
config is disabled inline with a command