-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Install Git for Windows with symbolic links enabled #1186
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
We only offer Windows environments that support symbolic links, meaning: if running either as administrator, or with Windows' Developer Mode enabled, symbolic links can be created. However, Git for Windows' auto-detection assumes that if it is installed by an administrator, it cannot detect whether "regular" users can create symbolic links, and by way of playing it safe, disables symlink support. Since we know better, we can avoid the auto-detection.
al-cheb
approved these changes
Jul 6, 2020
maxim-lobanov
approved these changes
Jul 6, 2020
sergey-akhalkov
approved these changes
Jul 6, 2020
miketimofeev
approved these changes
Jul 6, 2020
AlenaSviridenko
approved these changes
Jul 6, 2020
6 tasks
EliahKagan
added a commit
to EliahKagan/GitPython
that referenced
this pull request
Nov 30, 2023
The test assumes symlinks are never created on Windows. This often turns out to be correct, because core.symlinks defaults to false on Windows. (On some Windows systems, creating them is a privileged operation; this can be reconfigured, and unprivileged creation of symlinks is often enabled on systems used for development.) However, on a Windows system with core.symlinks set to true, git will create symlinks if it can, when checking out entries committed to a repository as symlinks. GitHub Actions runners for Windows do this ever since actions/runner-images#1186 (the file is now at images/windows/scripts/build/Install-Git.ps1; the `/o:EnableSymlinks=Enabled` option continues to be passed, causing Git for Windows to be installed with core.symlinks set to true in the system scope). For now, this adds an xfail marking to test_index_mutation, for the FileNotFoundError raised when a symlink, which is expected not to be a symlink, is passed to `open`, causing an attempt to open its nonexistent target. (The check itself might bear refinement: currently it reads the core.symlinks variable from any scope, including the local scope, which at the time of the check will usually be the cloned GitPython directory, where pytest is run.) While adding an import, this commit also improves the grouping and sorting of existing ones.
EliahKagan
added a commit
to EliahKagan/GitPython
that referenced
this pull request
Nov 30, 2023
The test assumes symlinks are never created on Windows. This often turns out to be correct, because core.symlinks defaults to false on Windows. (On some Windows systems, creating them is a privileged operation; this can be reconfigured, and unprivileged creation of symlinks is often enabled on systems used for development.) However, on a Windows system with core.symlinks set to true, git will create symlinks if it can, when checking out entries committed to a repository as symlinks. GitHub Actions runners for Windows do this ever since actions/runner-images#1186 (the file is now at images/windows/scripts/build/Install-Git.ps1; the `/o:EnableSymlinks=Enabled` option continues to be passed, causing Git for Windows to be installed with core.symlinks set to true in the system scope). For now, this adds an xfail marking to test_index_mutation, for the FileNotFoundError raised when a symlink, which is expected not to be a symlink, is passed to `open`, causing an attempt to open its nonexistent target. (The check itself might bear refinement: as written, it reads the core.symlinks variable from any scope, including the local scope, which at the time of the check will usually be the cloned GitPython directory, where pytest is run.) While adding an import, this commit also improves the grouping and sorting of existing ones.
EliahKagan
added a commit
to EliahKagan/GitPython
that referenced
this pull request
Dec 1, 2023
The test assumes symlinks are never created on Windows. This often turns out to be correct, because core.symlinks defaults to false on Windows. (On some Windows systems, creating them is a privileged operation; this can be reconfigured, and unprivileged creation of symlinks is often enabled on systems used for development.) However, on a Windows system with core.symlinks set to true, git will create symlinks if it can, when checking out entries committed to a repository as symlinks. GitHub Actions runners for Windows do this ever since actions/runner-images#1186 (the file is now at images/windows/scripts/build/Install-Git.ps1; the `/o:EnableSymlinks=Enabled` option continues to be passed, causing Git for Windows to be installed with core.symlinks set to true in the system scope). For now, this adds an xfail marking to test_index_mutation, for the FileNotFoundError raised when a symlink, which is expected not to be a symlink, is passed to `open`, causing an attempt to open its nonexistent target. (The check itself might bear refinement: as written, it reads the core.symlinks variable from any scope, including the local scope, which at the time of the check will usually be the cloned GitPython directory, where pytest is run.) While adding an import, this commit also improves the grouping and sorting of existing ones.
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.
Description
Bug fix: enable symlink support of Git for Windows
@al-cheb reached out privately to ask whether it would be a good idea to enable Git's symbolic link support, and I think it makes sense.