Prevent GitHub's web conflict editor from converting LF to CRLF#148739
Open
hugovk wants to merge 2 commits intopython:mainfrom
Open
Prevent GitHub's web conflict editor from converting LF to CRLF#148739hugovk wants to merge 2 commits intopython:mainfrom
hugovk wants to merge 2 commits intopython:mainfrom
Conversation
Member
|
It seems there is a NEWS entry with CRLF endings: https://github.com/python/cpython/actions/runs/24613765518/job/71972503301?pr=148739 |
Member
Author
|
Converted that to LF too. |
StanFromIreland
approved these changes
Apr 18, 2026
This file contains hidden or 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
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.
I resolved a conflict in a PR using the GitHub web editor, using Chrome on macOS, which involved moving lines around. However, GitHub also changed the LF endings to CRLF:
7208828
So I had to fix it locally:
fede255
I don't know why GitHub does this. It doesn't seem to do it for simple edits, moving lines appears to be important.
A similar thing happened recently with f938f01, which only affected a few lines.
We added extra linting (#148336) to help catch stuff like this, but it only checks that the endings match the majority. That won't pick up whole file changes!
Anyway, doing some tests, GH does at least respect
.gitattributes, so let's declare it.