Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Issues with CR/LF.

Is this still really a thing? even notepad can handle LF. I guess the default could still be crlf for some apps.



I think one of the main problems is that when you install git for windows, the default setting is to convert LF to CRLF when checking out code. This can cause a bunch of issues if you later try to work with those files within WSL (especially when doing any git-related stuff). I don't really understand why that's the default, or even why it's presented as an option during installation, it's been ages since I actually had issues reading/editing Unix-style files in Windows.


It is insane to me that git doesn't checkout/in as-is by default on Windows.


The biggest gotcha on Mac is using git on the default case-insensitive volume. I always create a separate case-sensitive APFS volume for all my git repos to avoid subtle mismatches between the filename git knows about and the filename macOS knows.


because of crap like notepad


I always wondered. Source?


notepad is the default text editor in windows, it doesn't support Unix line endings until insider build whatever


Notepad changed 3 years ago so now this isn't a problem. Git should default everything to LF. https://devblogs.microsoft.com/commandline/extended-eol-in-n...


that's a Windows 10 insider build, git for windows presumably wants to be more backwards compatible

just change it to input and be happy


The new notepad version was released to non-insiders in Windows 10 1809, so it's still been around for almost 3 years now. I do understand that git wants to maintain the best compatibility, but at this point I would argue that converting to CRLF on checkout is causing more issues than it solves.


Sure, but is that really the reason why autocrlf is the default in git?


it's the default in git-for-windows

I see no other reason that maximum platform compatibility


Would be weird if platfrom compatibility is measured by making sure once single program works, a program which most of the people using git probably don't even use


It's usually the other way around these days - most Windows apps can handle LF just fine, but Unix apps often cannot handle CR LF. So if you use Windows to generate a text file, things break when you try to use it from WSL.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: