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
Yann Droneaud <ydroneaud@opteya.com>
Date
Jun 24, 2013, 12:42 UTC
Message-ID
<b8e932cba326588db09ebd0986913ac2@meuh.org>
In-Reply-To
<7vip17ktyz.fsf@alter.siamese.dyndns.org>
Hi,
Le 21.06.2013 23:57, Junio C Hamano a écrit :
Show 7 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
>
>> The helper may want to learn a way to be told to demote that error
>> to a warning.
>
> Perhaps something like this?
>
Thanks for the patch.

I run my test again, eg. run git diff after a rebase failure (see my other mail about core.safecrlf), I'm able to run git diff a get a meaningful output:

# git version 1.8.1.4 fatal: CRLF would be replaced by LF in test.

# git version 1.8.3.1.741.g635527f.dirty (eg. next + your patch) warning: CRLF will be replaced by LF in test. The file will have its original line endings in your working directory.

diff --git a/test b/test
index b043836..63ba10f 100644
--- a/test
+++ b/test
@@ -1,4 +1,4 @@
-Hello World 1
-Hello World 2
-Hello World 3
+Hello World 1
+Hello World 2
+Hello World 3
  Hello World 4
\ No newline at end of file

It seems better. The removed lines have CRLF EOL while the added line 
have LF line ending characters.

Tested-By: Yann Droneaud <ydroneaud@opteya.com>


Regards.
-- 
Yann Droneaud
OPTEYA
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 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.