forked from git/git
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Avoid traversing NTFS junction points in git clean -dfx
#2268
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
drizzd
force-pushed
the
dont-clean-junctions
branch
from
July 20, 2019 07:56
760282d
to
9c21644
Compare
drizzd
force-pushed
the
dont-clean-junctions
branch
from
July 20, 2019 08:07
9c21644
to
6970f46
Compare
dscho
requested changes
Jul 22, 2019
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 left a couple of comments, and I'd really like to see this rebased so that the merge commit in this PR is no longer necessary.
@drizzd thank you! |
drizzd
force-pushed
the
dont-clean-junctions
branch
2 times, most recently
from
July 23, 2019 15:49
ba5039e
to
34a1bd4
Compare
It seems to be not exactly rare on Windows to install NTFS junction points (the equivalent of "bind mounts" on Linux/Unix) in worktrees, e.g. to map some development tools into a subdirectory. In such a scenario, it is pretty horrible if `git clean -dfx` traverses into the mapped directory and starts to "clean up". Let's just not do that. Let's make sure before we traverse into a directory that it is not a mount point (or junction). This addresses git-for-windows#607 Signed-off-by: Johannes Schindelin <[email protected]>
Windows' equivalent to "bind mounts", NTFS junction points, can be unlinked without affecting the mount target. This is clearly what users expect to happen when they call `git clean -dfx` in a worktree that contains NTFS junction points: the junction should be removed, and the target directory of said junction should be left alone (unless it is inside the worktree). Signed-off-by: Johannes Schindelin <[email protected]>
We will use this in the next commit to implement an FSCache-aware version of is_mount_point(). Signed-off-by: Johannes Schindelin <[email protected]>
When FSCache is active, we can cache the reparse tag and use it directly to determine whether a path refers to an NTFS junction, without any additional, costly I/O. Note: this change only makes a difference with the next commit, which will make use of the FSCache in `git clean` (contingent on `core.fscache` set, of course). Signed-off-by: Johannes Schindelin <[email protected]>
The `git clean` command needs to enumerate plenty of files and directories, and can therefore benefit from the FSCache. Signed-off-by: Johannes Schindelin <[email protected]>
drizzd
force-pushed
the
dont-clean-junctions
branch
from
July 23, 2019 16:31
34a1bd4
to
b7ca314
Compare
Thanks for your comments. It's done. |
dscho
approved these changes
Jul 23, 2019
Thank you so much, @drizzd! |
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jul 23, 2019
Avoid traversing NTFS junction points in `git clean -dfx`
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jul 23, 2019
Avoid traversing NTFS junction points in `git clean -dfx`
dscho
added a commit
to git-for-windows/build-extra
that referenced
this pull request
Jul 23, 2019
`git clean -dfx` [no longer follows NTFS junction points (also known as mount points)](git-for-windows/git#2268). Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jul 23, 2019
Avoid traversing NTFS junction points in `git clean -dfx`
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jul 23, 2019
Avoid traversing NTFS junction points in `git clean -dfx`
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jul 25, 2019
Avoid traversing NTFS junction points in `git clean -dfx`
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jul 25, 2019
Avoid traversing NTFS junction points in `git clean -dfx`
git-for-windows-ci
pushed a commit
that referenced
this pull request
Aug 12, 2019
Avoid traversing NTFS junction points in `git clean -dfx`
git-for-windows-ci
pushed a commit
that referenced
this pull request
Aug 12, 2019
Avoid traversing NTFS junction points in `git clean -dfx`
git-for-windows-ci
pushed a commit
that referenced
this pull request
Aug 12, 2019
Avoid traversing NTFS junction points in `git clean -dfx`
git-for-windows-ci
pushed a commit
that referenced
this pull request
Aug 12, 2019
Avoid traversing NTFS junction points in `git clean -dfx`
git-for-windows-ci
pushed a commit
that referenced
this pull request
Aug 14, 2019
Avoid traversing NTFS junction points in `git clean -dfx`
git-for-windows-ci
pushed a commit
that referenced
this pull request
Aug 14, 2019
Avoid traversing NTFS junction points in `git clean -dfx`
git-for-windows-ci
pushed a commit
that referenced
this pull request
Aug 16, 2019
Avoid traversing NTFS junction points in `git clean -dfx`
1 task
dscho
added a commit
that referenced
this pull request
Aug 22, 2019
Avoid traversing NTFS junction points in `git clean -dfx`
git-for-windows-ci
pushed a commit
that referenced
this pull request
Aug 23, 2019
Avoid traversing NTFS junction points in `git clean -dfx`
git-for-windows-ci
pushed a commit
that referenced
this pull request
Sep 2, 2019
Avoid traversing NTFS junction points in `git clean -dfx`
dscho
added a commit
that referenced
this pull request
Sep 24, 2019
Avoid traversing NTFS junction points in `git clean -dfx`
git-for-windows-ci
pushed a commit
that referenced
this pull request
Sep 30, 2019
Avoid traversing NTFS junction points in `git clean -dfx`
dscho
added a commit
that referenced
this pull request
Oct 2, 2019
Avoid traversing NTFS junction points in `git clean -dfx`
git-for-windows-ci
pushed a commit
that referenced
this pull request
Oct 7, 2019
Avoid traversing NTFS junction points in `git clean -dfx`
git-for-windows-ci
pushed a commit
that referenced
this pull request
Oct 17, 2019
Avoid traversing NTFS junction points in `git clean -dfx`
dscho
added a commit
that referenced
this pull request
Oct 21, 2019
Avoid traversing NTFS junction points in `git clean -dfx`
1 task
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.
This addresses #607.
Based on #1976.