-
Notifications
You must be signed in to change notification settings - Fork 128
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
Project doesn't build on Windows due to crlf defaults #228
Comments
For the record: we started discussing this in #215 (comment)
Strange.
No, it is not. https://stackoverflow.com/a/48230871 says the following:
Apparently, it works out of the box on our Windows CI. Could please some other windows user (e.g. @gevegab ) confirm or deny that he/she gets all files checked out with CRLF end of lines on Windows? Sorry if this is a well known common behavior, but I never heart of it. |
@digulla could you please confirm, that |
The default configuration in my machine is :
You can notice that The Git for Windows documentation states the following :
So apparently $PROGRAMDATA/Git/config is a location that can be modified by other Git implementations. I do remember some installer asked me at some point to choose a value for Anyway, with this configuration the build fails because of the .editorconfig validation. I tried to manually change the local configuration to workaround the problem :
But then I had to remove all the files in the cloned repository (keeping only the .git directory) and then restore them back with the good line endings using After that, the project builds without any additional step using the provided mvnw.cmd. Although one integration test is failing (but I guess that's another issue) :
The first time I started working on this project effectively the build failed, but I found quickly it was because of the line endings and I simply set the I do not know whether adding a .gitattributes is a good idea or not, but I have to say that at least things are clear and explicit using the editorconfig . In any case, if you decide to add a .gitattributes, you have to especially consider the integration tests that have different test cases for windows and linux. For instance, in test update-file-header-test-mojo I added a test file for windows test.crlf.sh (with CR-LF endings) and the corresponding test file for linux test.sh (with LF endings). Of course I also added the appropriate .editorconfig |
I have not touched it and I never cared so I do not know. Feel free to add From my PoV, this looks like a git misconfiguration on the user's side. It is defintely good that the editorconfig plugin is there to tell the user that he has a problem. Now, you guys seem to indicate that this issue may tend to be very common on Windows because some Windows tools default to |
The same issue here. The To fix this issue you could move the editorconfig plugin to a profile and use that profile just only on CI system (activated by when a environment variable is present for example). Or create a new profile that based on the OS value the editorconfig property file path to a the specific one. |
Let's put it very clearly: The two valid solutions I see ATM are (a) recommend users setting or (b) find a maintainable setup in |
If so than you could close the issue |
Windows users, I am still open to accept a |
This is to discuss the need of a
.gitattributes
file.git config --list --show-origin
shows thatcore.autocrlf
is not defined. I think the default istrue
.How about dropping
.editorconfig
and configuring Git in such a way that it will work for everyone out of the box, no matter howautocrlf
is configured? I have about 50 Git projects from all kinds of sources checked out right now. Your project is the only one which doesn't build after checkout because of EOL issues.The text was updated successfully, but these errors were encountered: