21
2erXre5
7y

Why the f*** was the computer industry not able to contract to common line endings? The trouble started many years ago when I was coding scripts on my Windows machine and they were not every time able to run on a Linux machine. Well I then somehow learned on the hard tour that this is due to wrong line endings. Thought that might be the last time I've seen such problems in my career...

And 10 years later I was going to migrate from CVS and SVN to git, and BAM: the f****** line endings appears to be causing much more problems than in all the ten years before. Why? I ask why is this still necessary in 2017 that a dev has to think about the line endings anymore?? This is so 1991!!!

Comments
  • 4
    Yes, it sucks.
    For git you can configure how to treat it (change, keep, ignore).
    But so many tools depend on the right line endings, it's a PITA
  • 1
    @ddephor I know that setting auto.crlf will help in that case, but sometimes it will simply not work as expected. We had an issue that someone was editing and committing directly from gitlab. And 💥 there was a CRLF right in the repo which should contain only LF.. WTF?!
  • 1
    Yeah, my windows git is set to always commit Linux style line endings. Sometimes a file will end up with doubled up line spacings, but it's quite rare
  • 1
    It's easy to automatically use LF in Text Editors and IDEs these days.
  • 1
    @2erXre5 Either setting to change line endings may not help you at all. If you're lucky, you can control the line endings of you're project, but often you're doing things for several systems and then the only setting is keep line endings as-is and fiddle with the other tools.

    Biggest problem are human failures. I've seen people using only windows and still managing to commit some LF here and there. However they did that, it fucks up everything.
    Best would be to automatically correct line endings before commit, but that won't go fully automatic in every case so in the end it's still the responsibility of the developer. So we're screwed furthermore...
  • 0
    @ddephor it is as you say, and that's exactly my rant: why do we still have to think about the line endings? It would me much more pleasant when every dev would just ignore that there are different kinds of them 😏
  • 0
    I always put my .gitattributes on all my repo :)
Add Comment