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

Re: osx autocrlf sanity?

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Jun 10, 2020, 00:03 UTC
Message-ID
<20200610000358.GR6569@camp.crustytoothpaste.net>
In-Reply-To
<CACPiFCK0h0LfdyE6Q=UJkuX+Qdb=rULcgDJwgxQ0w-1O0zpMew@mail.gmail.com>
On 2020-06-09 at 23:31:23, Martin Langhoff wrote:
Show 6 quoted lines
> Hi Brian,
> 
> good question! There is a .gitattributes file, all the files affected
> have these attributes
> 
> *.py     text diff=python

By default, Git will check out files with the text attribute with the native line ending, and it will check them in with LF endings. That can be controlled by core.eol and core.autocrlf.

If the file in the repository (as shown by a "git show HEAD:filename") has CRLF endings (usually less shows this as "^M"), then the user has done something naughty by overriding the .gitattributes file with local overrides and checking data in nevertheless. If so, you'll have problems on a Unix system pretty much regardless, unless you set core.eol to "crlf", in which case you'll get all CRLF files.

It may be instructive to run "git diff --ws-error-highlight=all" to see what the changes are in the working tree compared to what's checked in. I suspect it will probably be line endings only.

-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
Previous: Martin LanghoffNext: Martin Langhoff
Message 4 of 11 in “osx autocrlf sanity?”
  1. Martin LanghoffJun 9, 2020
  2. brian m. carlsonJun 9, 2020
  3. Martin LanghoffJun 9, 2020
  4. brian m. carlsonJun 10, 2020
  5. Martin LanghoffJun 10, 2020
  6. Randall S. BeckerJun 10, 2020
  7. Martin LanghoffJun 10, 2020
  8. brian m. carlsonJun 10, 2020
  9. Torsten BögershausenJun 10, 2020
  10. Martin LanghoffJun 10, 2020
  11. Junio C HamanoJun 10, 2020

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.