3 ms·
I don't understand why tools view line endings as a "OS preference" and something that can be changed willy-nilly. Memory usage, speed, even correctness can be
by MichaelGG 12y ago
I don't understand why tools view line endings as a "OS preference" and something that can be changed willy-nilly.
Memory usage, speed, even correctness can be affected by changing newlines if a language supports string literals that span lines.
And who are these users on Windows editing documents that need \r\n anyways? Apart from the built-in Notepad which handles \n uselessly, I'm coming up short on why anyone would care. It's not like the Windows tools (find, fc, and so on) are that popular.
- leorocky 12y agoI think it's the default thing on Windows. Editors just add the the \r\n. That's what VisualStudio does yes? I don't really understand why \r\n is a thing anymore.
- ggreer 12y agoApparently, our customers are the users who need carriage returns. Instead of telling them to fix their configs and remove CRs from their source code, we decided to make things Just Work™. On Windows, it's not hard to get CRs in your source. With the default git config, cloning a repo gives you text files with CRLFs. Other source control systems do this as well. Many editors on Windows default to CRLF, but even those that auto-detect line endings won't help if your source control munges the lines.
- MichaelGG 12y agoYeah, git's default config also corrupts files by playing with line endings. Meaning the hash of a file on my Windows disk is different than on Linux. Meaning my strings are now shorter/longer. It confuses me just as much in git. I wonder what editors they're using on Windows that it matters. But good that you're listening to customers.