From: Jeff King <peff@peff.net>
To: Jens Bauer <jens-lists@gpio.dk>
Cc: Drew Northup <drew.northup@maine.edu>, git@vger.kernel.org
Subject: Re: CRLF, LF ... CR ?
Date: Thu, 13 Sep 2012 11:43:10 -0400 [thread overview]
Message-ID: <20120913154309.GB726@sigill.intra.peff.net> (raw)
In-Reply-To: <1347550490.24469.54.camel@drew-northup.unet.maine.edu>
On Thu, Sep 13, 2012 at 11:34:50AM -0400, Drew Northup wrote:
> > I've read that git supports two different line endings; either CRLF or LF, but it does not support CR.
> > Would it make sense to add support for CR (if so, I hereby request it as a new feature) ?
>
> Even if Git can't do CRLF/LF translation on a file it will still store
> and track the content of it it just fine. In fact you probably want
> translation completely disabled in this case.
Yeah. If the files always should just have CR, then just don't ask git
to do any translation (by not setting the "text" attribute, or even
setting "-text" if you have something like autocrlf turned on globally),
and it will preserve the bytes exactly. I suspect diffs will look nasty
because we won't interpret CR as a line-ending, though.
Do the files actually need line-by-line diffing and merging? If not,
then you are fine.
If so, then it would probably be nice to store them with a canonical LF
in the repository, but convert to CR on checkout. Git can't do that
internally, but you could define clean/smudge filters to do so (see the
section in "git help attributes" on "Checking-out and checking-in";
specifically the "filter" subsection).
-Peff
next prev parent reply other threads:[~2012-09-13 15:43 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-13 15:09 CRLF, LF ... CR ? Jens Bauer
2012-09-13 15:34 ` Drew Northup
2012-09-13 15:43 ` Jeff King [this message]
2012-09-13 15:53 ` Jens Bauer
2012-09-13 18:17 ` Jens Bauer
2012-09-13 18:23 ` Jeff King
2012-09-13 18:55 ` Jens Bauer
2012-09-13 18:34 ` Johannes Sixt
2012-09-13 19:13 ` Jens Bauer
2012-09-13 15:43 ` Erik Faye-Lund
2012-09-14 4:06 ` David Aguilar
2012-09-14 4:36 ` Jens Bauer
2012-09-14 4:51 ` Junio C Hamano
2012-09-26 8:42 ` David Aguilar
2012-09-26 10:12 ` Jens Bauer
2012-09-26 10:31 ` Jens Bauer
2012-09-27 6:16 ` Junio C Hamano
2012-09-27 13:42 ` Jens Bauer
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=20120913154309.GB726@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=drew.northup@maine.edu \
--cc=git@vger.kernel.org \
--cc=jens-lists@gpio.dk \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).