-
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
Specify symlink type in .gitattributes #1897
Conversation
Signed-off-by: Bert Belder <[email protected]>
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.
This looks pretty awesome already, and I like this idea of specifying the symlink type via the Git attributes! I offered a couple of suggestions how to change this, hopefully you agree that those are improvements?
|
||
# Tell MSYS to create native symlinks. Without this flag test-lib's | ||
# prerequisite detection for SYMLINKS doesn't detect the right thing. | ||
MSYS=winsymlinks:nativestrict && export MSYS |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
On Windows, symbolic links have a type: a "file symlink" must point at a file, and a "directory symlink" must point at a directory. If the type of symlink does not match its target, it doesn't work. Git does not record the type of symlink in the index or in a tree. On checkout it'll guess the type, which only works if the target exists at the time the symlink is created. This may often not be the case, for example when the link points at a directory inside a submodule. By specifying `symlink=file` or `symlink=dir` the user can specify what type of symlink Git should create, so Git doesn't have to rely on unreliable heuristics. Signed-off-by: Bert Belder <[email protected]>
@dscho Thanks for the review. I've updated the patch, PTAL. |
Signed-off-by: Bert Belder <[email protected]>
Excellent. Thank you so much! |
The type of symlinks to create (directory or file) [can now be specified via the `.gitattributes`](git-for-windows/git#1897). Signed-off-by: Johannes Schindelin <[email protected]>
Specify symlink type in .gitattributes
Specify symlink type in .gitattributes
Specify symlink type in .gitattributes
Specify symlink type in .gitattributes
Specify symlink type in .gitattributes
Specify symlink type in .gitattributes
Specify symlink type in .gitattributes
Specify symlink type in .gitattributes
Specify symlink type in .gitattributes
Specify symlink type in .gitattributes
Specify symlink type in .gitattributes
Specify symlink type in .gitattributes
Specify symlink type in .gitattributes
Specify symlink type in .gitattributes
Specify symlink type in .gitattributes
Specify symlink type in .gitattributes
Specify symlink type in .gitattributes
Specify symlink type in .gitattributes
Specify symlink type in .gitattributes
Specify symlink type in .gitattributes
Specify symlink type in .gitattributes
Specify symlink type in .gitattributes
Specify symlink type in .gitattributes
Specify symlink type in .gitattributes
Specify symlink type in .gitattributes
Specify symlink type in .gitattributes
Specify symlink type in .gitattributes
Specify symlink type in .gitattributes
Specify symlink type in .gitattributes
Specify symlink type in .gitattributes
Specify symlink type in .gitattributes
Specify symlink type in .gitattributes
Specify symlink type in .gitattributes
Specify symlink type in .gitattributes
Specify symlink type in .gitattributes
Specify symlink type in .gitattributes
Specify symlink type in .gitattributes
Specify symlink type in .gitattributes
Specify symlink type in .gitattributes
On Windows, symbolic links have a type: a "file symlink" must point at
a file, and a "directory symlink" must point at a directory. If the
type of symlink does not match its target, it doesn't work.
Git does not record the type of symlink in the index or in a tree. On
checkout it'll guess the type, which only works if the target exists
at the time the symlink is created. This may often not be the case,
for example when the link points at a directory inside a submodule.
By specifying
symlink=file
orsymlink=dir
the user can specify whattype of symlink Git should create, so Git doesn't have to rely on
unreliable heuristics.