Closed ckolumbus closed 2 years ago
How should line endings be handled when there is a mix of operating systems among contributors to a particular Doorstop project? Shouldn't doorstop
write consistent line endings and Git be configured to handle that?
@jacebrowning git has already support for this (stupid) situation, check this for some more information. when doorstop tries to do it by itself, the git needs to be configured to specifically ignore its own mechanism for this files.
So my preferred solution would be to have OS specific line endings and have git handle the conversion when working across OSes.
BTW: cross-OS development happens more often nowadays. I'm a heavy user of DevContainers inside VSCode. So i have my git source code repo (with doorstop requirements) checked out natively on windows and inside DevContainers, which run Linux.
So my preferred solution would be to have OS specific line endings and have git handle the conversion when working across OSes.
👍🏻
I can implement the solution, but what would you prefere
let me know, then I could make a PR
@ckolumbus Let go with os.linesep
wherever "\n"
is used.
Reference to older issues about CRLF warnings: #310 , #480 .
when using doorstop within a development project we have everything is set to
autocrlf=true
. On windows this leads tocrlf
as line ending and on linux onlylf
.autocrlf
takes care of proper line ending the the working copy.doorstop is hardcoded to
lf
only incommon.py:write_text
function. This should use the OS dependentos.linesep
by default to avoid different line ending encodings in repositories.Additionally: this could be made configurable, but the
end
parameter to thewrite_text
function is never used anyway. Maybe this could be adjusted, too.Opinions? Feedback?