5 ms·
Considering there are people who have heart attacks based on whether a file ends with a newline or not, commit message formatting is a hugely important topic.
by zorked 11y ago
Considering there are people who have heart attacks based on whether a file ends with a newline or not, commit message formatting is a hugely important topic.
- Cthulhu_ 11y agoThat's because there's some unix commandline tools that won't work right when a file does not end with a newline.
- eropple 11y agoFor serious. For just one example, `cat` doesn't act as expected without a trailing newline. You end up with stuff like <(echo) to space things out and it's really bogus.
- jodrellblank 11y agolol. You'd think if "it's open source you can fix it yourself" worked as an ideology, its heartland would be Unix commandline text processing tools.
- gkya 11y ago> "If it's open source you can fix it yourself, given that it is not standardised somehow, and that you have time to spare, and that you have the skills and knowhow to do it or that you possess the financial resources to hire some developers to do it for you. FTFY.
- the_why_of_y 11y agoActually the ISO C99 language standard requires that every source file ends with a newline (§5.1.1.2, 2.): "A source file that is not empty shall end in a new-line character [...]" So if your C implementation doesn't complain about source files that don't end with a newline, you're unknowingly relying on a language extension.
- GrumpyBen 11y agoTry to use cat with a file that doesn't end with a newline.