Skip to content

Prevent GitHub's web conflict editor from converting LF to CRLF#148739

Open
hugovk wants to merge 2 commits intopython:mainfrom
hugovk:3.15-rst-eol
Open

Prevent GitHub's web conflict editor from converting LF to CRLF#148739
hugovk wants to merge 2 commits intopython:mainfrom
hugovk:3.15-rst-eol

Conversation

@hugovk
Copy link
Copy Markdown
Member

@hugovk hugovk commented Apr 18, 2026

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.

@StanFromIreland
Copy link
Copy Markdown
Member

It seems there is a NEWS entry with CRLF endings: https://github.com/python/cpython/actions/runs/24613765518/job/71972503301?pr=148739

@hugovk
Copy link
Copy Markdown
Member Author

hugovk commented Apr 18, 2026

Converted that to LF too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants