New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't convert windows style \r\n to \n in file-contents-sorter #959
Conversation
Instead preserve the original line endings. With the `--unique` flag identical lines with different line endings are collapsed to the first entry.
this is a really complicated change. I'd rather keep the existing behavior and just say windows newlines are unsupported |
I understand, yet I think this is going to cause headaches for windows users or even more to people who don't regularly use windows for development, but have CI pipelines that also run pre-commit on windows (like I did). What about keeping only the |
imo it's 2023 and most tools support posix newlines -- we should just let windows newlines die rather than adding more complexity to support them |
that is to say -- if you're testing both posix and windows it might make sense to configure git to be more posixlike on windows |
@asottile this pull request and the accompanying issue are old, but I still want to have a discussion about this topic. I start with some background: We have several large repositories that share their quality assurance tooling. Right before starting the actual work (unfortunately, at scale it is not that easy to just add the
Reading this, I was somewhat disappointed, not because I prefer the one or other operating system - I really just don't care - but the state it leaves me as potential user:
So why does this tool force OS specific things onto the user, when they are on a platform that behaves different? Linux is like that, POSIX is like that, and Windows is like that and so on. Apart from any discussion what is or is not correct: There are lots of domains where Windows is the default development environment, and you need to play by the operating system rules. Yeah, these domains are not the modern and shiny Internet, AI, etc. things, but automotive, generally software for embedded systems and many more. Why the large picture? It's not about the tool itself, but the spirit it lives in the default hooks:
My question is (sorry I know this sounds snappy, but it is not meant that way): Is the plan of this project to focus on the hooking functionality for git and providing basic hooks without an opinion what the correct operating behavior or is the plan to be more opinionated (e.g., like I would greatly appreciate, if you have the time to discuss this a bit. I want to add these side two notes, because they show that whatever the correct line separator is,
|
I'm not reading all of that. if you want to add the complexity and maintain it by all means fork the repository to do what you want |
Instead preserve the original line endings.
With the
--unique
flag identical lines with different line endings are collapsed to the first entry.Fixes: #958