-
Notifications
You must be signed in to change notification settings - Fork 5k
[9.0] Fix line endings #115413
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
[9.0] Fix line endings #115413
Conversation
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.
Pull Request Overview
This PR fixes inconsistent line endings that caused issues for Unix-style enlistments. The changes normalize line endings across several test project files.
- Updated the .csproj file for ApplyUpdate tests.
- Normalized line endings in IncreaseMetadataRowSize_v1.cs and IncreaseMetadataRowSize.cs.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
System.Reflection.Metadata.ApplyUpdate.Test.IncreaseMetadataRowSize.csproj | Adjusted line endings to Unix-style formatting. |
IncreaseMetadataRowSize_v1.cs | Normalized line endings and preserved code logic/formatting. |
IncreaseMetadataRowSize.cs | Normalized line endings with no functional changes. |
Also, the .EditorConfig does not specify the line ending for most files: |
Good point. Let's merge these PRs as-is and then develop a new standard for these configuration files to force LF that can be used as a pattern in other repos. Is there someone who can volunteer to do that? This isn't the first case I've seen of line ending confusion. It suspect most people are using Windows so they don't notice this. |
This looks familiar, and was in #114190 (comment) But I think that was only fixed for Ultimately, some people have configured their git client to do disable auto crlf and that made its way in. It doesn't matter what |
That doesn't stop us from having good configuration and documenting the preferred client config, right? |
That means you would be checking out files locally on Windows with LF, not CRLF line endings and I think that would massively confuse folks that checkout the runtime on Windows.
Likewise, that would be forcing one OS's line ending opinions on another. Changing the editorconfig to LF would mean Windows would prefer using LF locally. |
We used to have a section in the documentation that talked about how to clone a repo, but we dropped it since it is github 101 topic that is covered much better elsewhere. Our .gitattributes is setup to make the default git client config to do the right thing. You do not need to worry about line endings if you use vanilla git workflow. For mistakes like this to happen, one has to use advanced custom configs, like running multiple OSes side-by-side with shared file system or manually copying files between different OSes. |
Tagging subscribers to this area: @dotnet/runtime-infrastructure |
Tell mode |
git reset --hard
doesn't work)Before this change:
After this change:
Perhaps this line is wrong?
https://github.com/dotnet/runtime/blob/8ac2c2877ce98d9b28949a3beb717524b5e6e31b/.gitattributes#L30C1-L30C22
Should it be changed to the following?