Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Realtek: serial - line ending fix #6450
One line had a window line ending in Realtek HAL Serial implementation.
To reproduce, do a change in a file, and this line gets shown (line change to unix line endings):
Pull request type
To confirm, here is a view at line endings on current master
The line has CR.
Build number : 1567
Build number : 1206
This is now broken on all our workspaces.. not just CI.
If you have cloned mbed-os earlier and checkout master branch and then try to check out some other branch, you will see the same issue.
Problem is that if you Git is (properly) configured to convert line endings, then you see this issue.
If your Git is NOT configured, then all our files are randomly either Windows or Unix line endings. Depending on who touched that file previously.
Based on the impact, I am happy to get this in (one line change, no code change, only line ending). the flow in our CI is correct (git checkout branches, I got now the same problem locally as was switching between branches ), we will need to review gitattributes or other options to stay away from this line endings breakages.
Mar 26, 2018
11 of 12 checks passed
referenced this pull request
Mar 26, 2018
If someone does manage to bypass/ignore .gitattributes and check in an unnormalised file, Git clients that do obey it get confused when they see the unnormalised file in the repo.
Basically they immediately try to normalise it in the work area, which marks the file as locally changed, which blocks some commands.
It's unfortunate that the normal CI sequence for the PR that breaks it doesn't see the problem, while the CI for subsequent PRs does.
You could use astyle to do a line-ending check, but I think the CI should (also?) programmatically use Git to check for this specific normalisation problem.
The return code of