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

reset: fix mixed reset when using virtual filesystem (again) #651

Merged
merged 1 commit into from
Jun 3, 2024

Conversation

derrickstolee
Copy link
Collaborator

@derrickstolee derrickstolee commented May 10, 2024

This should fix #646, at least in the case that I've been able to verify.

The issue is that reset was setting the skip-worktree bit more frequently than it should have. The previous fix in #494 was focused on the case where a file is added or removed across the diff. However, when the file exists on both sides but still needs to be staged in a mixed reset then we should avoid the skip-worktree bit.


This fork contains changes specific to monorepo scenarios. If you are an
external contributor, then please detail your reason for submitting to
this fork:

  • This change only applies to the virtualization hook and VFS for Git.

This should fix git#490, at least in the case that I've been able to
verify.

The issue is that reset was setting the skip-worktree bit more
frequently than it should have. The previous fix in git#494 was focused on
the case where a file is added or removed across the diff. However, when
the file exists on both sides but still needs to be staged in a mixed
reset then we should avoid the skip-worktree bit.

Signed-off-by: Derrick Stolee <[email protected]>
@derrickstolee derrickstolee self-assigned this May 10, 2024
@derrickstolee
Copy link
Collaborator Author

I wanted to validate this change with the VFS for Git functional tests, but I'm not able to run the installer generation build.

@rossnichols
Copy link

Thanks for taking a look at this, @derrickstolee! Based on your understanding of the issue, do you know how I can work around it in the meantime? I can't figure out locally what causes some files to work and some to not. I frequently unstage my changes to more easily iterate on them (editing the diff view directly in VSCode), and this bug prevents doing so with confidence.

Copy link
Member

@dscho dscho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense, we definitely want to avoid adding the SKIP_WORKTREE bit even if we did not check out the file.

@dscho dscho marked this pull request as ready for review June 3, 2024 19:14
@dscho dscho merged commit d06fa44 into microsoft:vfs-2.45.0 Jun 3, 2024
46 of 48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Git reset --mixed HEAD~1 does not leave modified files in working tree
3 participants