Unix-mode newlines
Michael Richardson
mcr at sandelman.ca
Sat Nov 13 09:49:31 AEDT 2021
Patrick Williams <patrick at stwcx.xyz> wrote:
> Generally we've had a preference for Unix-style newlines (\n) and not DOS-style
> newlines (\r\n), but it has never been documented. I've recently found
> a small number of files that are either DOS-style or mixed-styles and I've been
> fixing them as I've ran into them.
Check out "man gitattributes"
You create a file like:
% cat .gitattributes
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto
# Explicitly declare text files you want to always be normalized and converted
# to native line endings on checkout.
*.yang text
*.txt text
*.md text
*.mkd text
...
and then git translates in/out.
Which is the default in the "repo" is up to you.
It takes a hit where many files with the "wrong" line endings have to
tweaked, but then it's done.
--
] Never tell me the odds! | ipv6 mesh networks [
] Michael Richardson, Sandelman Software Works | IoT architect [
] mcr at sandelman.ca http://www.sandelman.ca/ | ruby on rails [
More information about the openbmc
mailing list