Skip to content
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

Convert all files to LF file ending #209

Closed
wants to merge 1 commit into from

Conversation

MartinHruza
Copy link
Contributor

Hi again, since my previous (first!) pull request was appreciated I prepared another, more radical, one.

LF is the defacto standard since it's used by Mac and Linux and Windows are mostly fine with it (batch files may be the only exception where LF endings cause troubles). Until this commit most of the files in this repo used a LF line endings anyway, the only exception were *.ino files which mostly used CRLF with couple of lines with LF. These mixed line endings cause troubles to those using VSCode since it doesn't support it (microsoft/vscode#127) so it's impossible to save a changed file without normalizing its line endings (and making the commit much bigger). This commit also introduces .gitattribute and .editorconfig files which will ensure correct formating in the future (strangely Arduino IDE doesn't support the latter one arduino/Arduino#8804).

I'm aware that this commit will make using of git blame and exploring of the project history a bit more difficult but it's better to bite the bullet now than later. Also I didn't send this pull request just to make the repo nice and tidy but to prepare the surface for more pull requests I have in the queue.

Here's a nice blog post about git and line edings if you want to learn more: https://www.aleksandrhovhannisyan.com/blog/crlf-vs-lf-normalizing-line-endings-in-git/

Thanks!

LF is the defacto standard since it's used by Mac and Linux and Windows are mostly fine with it (batch files may be the only exception). Until this commit most of the files in this repo used a LF line endings anyway, the only exception were *.ino files which mostly used CRLF with couple of lines with LF. These mixed line endings cause troubles to those using VSCode since it doesn't support it (microsoft/vscode#127) so it's impossible to save a changed file without normalizing its line endings. This commit also introduces .gitattribute and .editorconfig files which will ensure correct formating in the future (strangely Arduino IDE doesn't support the latter one arduino/Arduino#8804).
@Zer0-bit
Copy link
Owner

Zer0-bit commented May 5, 2022

Hmm... are you sure it's not smth going on on your end ? I just checked and all line endings are LF on my end from what i see.

@MartinHruza
Copy link
Contributor Author

D'oh.. my bad, sorry. Both *.ino files really use CRLF. They don't use mixed lined endings, I misinterpreted the output of git diff and that's where the confusion started.
It would be nice still to unifi the line endings across all files (see bellow) but since the line endings in ino files are not mixed, the need to merge this is a bit lower.

# ~/gaggiuino2$ git ls-files --eol
i/lf    w/lf    attr/                 	.github/ISSUE_TEMPLATE/bug_report.md
i/lf    w/lf    attr/                 	.github/ISSUE_TEMPLATE/custom.md
i/lf    w/lf    attr/                 	.github/ISSUE_TEMPLATE/feature_request.md
i/lf    w/lf    attr/                 	.github/workflows/compile-sketch.yml
i/lf    w/lf    attr/                 	.gitignore
i/lf    w/lf    attr/                 	LICENSE
i/lf    w/lf    attr/                 	README.md
i/crlf  w/crlf  attr/                 	gaggiuino.ino
i/-text w/-text attr/                 	images/GAGGIUINO_ICON_transp.png
i/-text w/-text attr/                 	images/GAGGIUINO_ICON_white.png
i/-text w/-text attr/                 	images/GAGGIUINO_LOGO_White.png
i/-text w/-text attr/                 	images/GAGGIUINO_LOGO_transp.png
i/-text w/-text attr/                 	images/Gaggiuino_ux.jpg
i/-text w/-text attr/                 	images/image1.jfif
i/-text w/-text attr/                 	lcd-hmi/nextion-lcd.HMI
i/-text w/-text attr/                 	nextion-basic-lcd.tft
i/-text w/-text attr/                 	nextion-discovery-lcd.tft
i/lf    w/lf    attr/                 	platformio.ini
i/      w/      attr/                 	platformio_src/gaggiuino.ino
i/-text w/-text attr/                 	schematics/GC-CONNECTIONS-DIAGRAM.png
i/-text w/-text attr/                 	schematics/GCP-CONNECTIONS-DIAGRAM.png
i/-text w/-text attr/                 	schematics/gc-schematics.png
i/-text w/-text attr/                 	schematics/gcp-schematics.png
i/crlf  w/crlf  attr/                 	troubleshooting/gaggiuino-debug.ino
i/lf    w/lf    attr/                 	troubleshooting/platformio.ini
i/      w/      attr/                 	troubleshooting/platformio_src/gaggiuino-debug.ino

@Zer0-bit
Copy link
Owner

Zer0-bit commented May 6, 2022

I'm gonna close it as it's not smth that's applicable, thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants