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

Re: git diff returns fatal error with core.safecrlf is set to true.

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 21, 2013, 15:44 UTC
Message-ID
<7vobazo4ds.fsf@alter.siamese.dyndns.org>
In-Reply-To
<6a3d8a2b19a859d8c969ee434e1d6a89@meuh.org>
Yann Droneaud <ydroneaud@opteya.com> writes:
Show 11 quoted lines
> While testing the behavor of Git regarding CRLF handling,
> when core.safecrlf is set to true, I've found that "git diff" is
> returning
> "fatal: CRLF would be replaced by LF" without returning any kind of
> diff.
>
> This make me wonder if its the correct behavor for git diff to (only)
> fail:
> It should be fatal for git add / git commit ( / git cherry-pick /
> ... ?),
> but non fatal for git diff.
Yeah, I agree.

This is a diff between something and the working tree file, right? It needs to convert from the working tree representation to the canonical repository representation before doing the actual comparison, and most likely the same helper function that is reused for the check-in codepath, which needs to error out, is erroring out after finding an input in your working tree that cannot safely round-trip between LF/CRLF world.

The helper may want to learn a way to be told to demote that error to a warning.

Previous: Yann DroneaudNext: Junio C Hamano
Message 2 of 8 in “git diff returns fatal error with core.safecrlf is set to true.”
  1. Yann DroneaudJun 21, 2013
  2. Junio C HamanoJun 21, 2013
  3. Junio C HamanoJun 21, 2013
  4. Yann DroneaudJun 24, 2013
  5. Junio C HamanoJun 24, 2013
  6. Junio C HamanoJun 24, 2013
  7. Torsten BögershausenJun 25, 2013
  8. Junio C HamanoJun 26, 2013

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.