All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Richardson <mcr@sandelman.ca>
To: Patrick Williams <patrick@stwcx.xyz>
Cc: OpenBMC List <openbmc@lists.ozlabs.org>
Subject: Re: Unix-mode newlines
Date: Fri, 12 Nov 2021 17:49:31 -0500	[thread overview]
Message-ID: <22450.1636757371@localhost> (raw)
In-Reply-To: <YY6TjcddpoYGmEK2@heinlein>

Patrick Williams <patrick@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@sandelman.ca  http://www.sandelman.ca/        |   ruby on rails    [







      reply	other threads:[~2021-11-12 22:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-12 16:17 Unix-mode newlines Patrick Williams
2021-11-12 22:49 ` Michael Richardson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=22450.1636757371@localhost \
    --to=mcr@sandelman.ca \
    --cc=openbmc@lists.ozlabs.org \
    --cc=patrick@stwcx.xyz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.