git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: CRLF, LF ... CR ?

From
David Aguilar <davvid@gmail.com>
Date
Sep 14, 2012, 04:06 UTC
Message-ID
<CAJDDKr5-ze2bhTkT+jzcS1iZipJO6kEr2qAf73GRn4QQ-rS1dQ@mail.gmail.com>
In-Reply-To
<20120913170943725232.01d717ef@gpio.dk>
On Thu, Sep 13, 2012 at 8:09 AM, Jens Bauer <jens-lists@gpio.dk> wrote:
Show 11 quoted lines
> Hi everyone.
>
> I'm quite fond of git, and have used it for a while.
> Recently, I've started making printed circuit boards (PCBs) using an application called OsmondPCB (for Mac), and I'd like to use git to track changes on these.
> This application was originally written for the old Mac OS (Mac OS 6 to Mac OS 9.2).
> The old Mac OS does not use LF, nor CRLF for line endings, but only CR.
>
> 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) ?
> The alternative is to ask the developer if he would change the file format, so that new versions of his software would change the files to end in LF, but he'd have to be careful not to break compatibility.
> If the software is to be changed, this would not fix similar issues that other people might have.
Do you mean that you want automatic conversion from CR to LF?

What's about just storing the files as-is, with no conversion at all? (this is the default git behavior)

git doesn't really even support LF. It stores content as-is which means LF works just fine. git prefers to not mess around with the content, but we do have autocrlf to help folks stuck on windows.

If you need to, you can use .gitattributes to add a clean/smudge filter that does this conversion for you.

See the "filter" section for an example:
http://www.kernel.org/pub/software/scm/git/docs/gitattributes.html

If you're serious about wanting that feature then we'll happily review any patches you might have. That said, I don't really think it's a common enough case for git to natively support, so I'd recommend going with the .gitattributes filter.

good luck,
-- 
David
Previous: Erik Faye-LundNext: Jens Bauer
Message 11 of 18 in “CRLF, LF ... CR ?”
  1. Jens BauerSep 13, 2012
  2. Drew NorthupSep 13, 2012
  3. Jeff KingSep 13, 2012
  4. Jens BauerSep 13, 2012
  5. Jens BauerSep 13, 2012
  6. Jeff KingSep 13, 2012
  7. Jens BauerSep 13, 2012
  8. Johannes SixtSep 13, 2012
  9. Jens BauerSep 13, 2012
  10. Erik Faye-LundSep 13, 2012
  11. David AguilarSep 14, 2012
  12. Jens BauerSep 14, 2012
  13. Junio C HamanoSep 14, 2012
  14. David AguilarSep 26, 2012
  15. Jens BauerSep 26, 2012
  16. Jens BauerSep 26, 2012
  17. Junio C HamanoSep 27, 2012
  18. Jens BauerSep 27, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.