Closed mewmew closed 8 years ago
Also, http://adaptivepatchwork.com/2012/03/01/mind-the-end-of-your-line/ may be worth a read for some backgroud.
I am aware of this you mention. I develop on Windows, hence why every file is CRLF. I will look into this later on.
I will look into this later on.
Thanks! It will make it much easier for Linux users to contribute to the project.
It's done.
It's done.
Wonderful! Thanks. I'll close this issue as it has been resolved by commit 67121f951d4fef467c3450b574e586547af491c1.
To facilitate contributions from developers working on different platforms, one thing to consider is the normalization of line endings.
TL;DR: Windows uses a two character sequence for line endings (CRLF - Carriage Return, Line Feed), while Linux and Mac uses a one character sequence for line endings. In order to make this consistent, we may leverage git commit hooks to normalize line endings for us. See further details below.
(Copied more or less verbatim from quixotic-cynic/open-diablo-editor#1)
GitHub suggests that the line feed character (LF,
0x0A
,'\n'
) should be used instead of the carriage return, line feed character sequence (CRLF,0x0D, 0x0A
,"\r\n"
).The reason for this is that Window, Linux and Mac all uses different character sequences to signal line endings. CRLF on Windows, CR on Mac and LF on Linux. Fortunately,
git
may be configured to automatically change these line endings to a uniform format (LF was chosen for this) on commit. This way, all three operating systems may use their line endings locally, while the code repository uses a single format for line endings.To configure Git to automatically convert CRLF on Windows to LF, before commits; simply run the following command:
As the repository already contains code which has CRLF line endings instead of LF line endings, it has to be resubmitted; as explained by the following Stack Overflow answer: http://stackoverflow.com/a/1889699
The gist of which is summarized below: