-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Enforce "\n" line endings on Windows #574
Conversation
With Windows line endings, which seems to be the default on Windows, the zig compiler won't understand std out of the box. This project should not rely on git's global core.autocrlf setting.
Hi there, btw! :) I've been following this project for a long time. Yesterday, I finally spent a couple hours building LLVM and Clang, and I got zig to compile out of the box. Awesome! But I ran into trouble with My favorite solution would be for zig to work with all types of line endings. If you make a Windows executable that is run on Windows by Windows users, I don't see why they should be forced to use non-Windows line endings. Otherwise this is something that every zig project would need to do: Provide a |
One thing we can do is allow crlf but replace them with |
I'm conflicted about this because the autocrlf feature of git is a misfeature. Git is mangling binary files (how does it really know the difference between text and binary?) Git is also mangling text files. Even for projects other than Zig, the autocrlf feature is better left off. It only causes trouble. |
https://stackoverflow.com/a/2825829/432
|
@haferburg do you know why autocrlf is enabled for you? usually it's disabled. did you turn it on? did it solve some problem for you? |
@thejoshwolfe According to this http://adaptivepatchwork.com/2012/03/01/mind-the-end-of-your-line/, core.eol = native is the default setting, which means CRLF on Windows. |
@haferburg yes. the defaults are core.eol = native, and core.autocrlf = false. The latter means that git is not going to convert/corrupt your files by default. |
looks like if a repo contains a .gitattributes file with |
@thejoshwolfe Hi again! You asked why autocrlf was enabled, and I just found out. When installing the client from https://gitforwindows.org/, there is a wizard that recommends setting |
With Windows line endings, which seems to be the default on Windows, the
zig compiler won't understand std out of the box. This project should
not rely on git's global core.autocrlf setting.