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
[TOML stdlib] Write toml files with \r\n
line endings on Windows
#42696
Comments
Do you have git setup to checkout text files with CRLF line endings? |
Yes, that is the default you get on Windows. The git setup presents that as the recommended option, so I would expect that most users on Windows run with that setting. |
Maybe we can just respect the git setting since Pkg is already git-aware. |
Was this fixed? |
@fredrikekre bump, just curios, was this fixed and therefore closed? |
Don't know. Closed since there is no TOML code here any more. |
I guess the first step would be to add a line-ending option to TOML.jl, but then there would still have to be work done here in Pkg.jl that controls what kind of line-ending should be used in a given write? So it seems to me that this issue here should stay open. |
This feature seems kind of fiddly. The |
I think that is really not true on Windows. If you just use git with the default configuration on Windows, all your text files will have I think the nicest behavior would be something like this:
Yes, that is more involved than one would wish, but I think all text editing tools on Windows just do it that way? |
Ok, if someone wants to figure out how to read the git setting (via libgit2, presumably?), adding an option to TOML to emit |
I wrote some stuff here earlier that was a bit wrong. Anyway, I think for existing files just replacating the existing could be done easily. For new files, I think just using |
Could we for now just reopen the issue here? |
Reminder — the next steps (for someone) here are:
|
\r\n
line endings on Windows
I think the ideal situation would be:
The main benefit would be that if these files are under git version control, and one has installed git with the default settings on Windows, then things are easier if these files have \r\n line endings: if I checkout a repo with these files in it, git will create these files with \r\n endings, because they are detected as a text file. If I then do say a
update
, then the file gets rewritten, but now with a \n line ending, even if nothing else changed. Then git shows me the file as modified, but the only change is the line ending, which is kind of annoying.The text was updated successfully, but these errors were encountered: