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 26, 2013, 15:48 UTC
Message-ID
<7vsj04yisa.fsf@alter.siamese.dyndns.org>
In-Reply-To
<51C9FDC0.5020709@web.de>
Torsten Bögershausen <tboegi@web.de> writes:
Show 15 quoted lines
>> +++ b/diff.c
>> @@ -2647,6 +2647,10 @@ static int diff_populate_gitlink(struct diff_filespec *s, int size_only)
>>  int diff_populate_filespec(struct diff_filespec *s, int size_only)
>>  {
>>  	int err = 0;
>> +	enum safe_crlf crlf_warn = (safe_crlf != SAFE_CRLF_FAIL
>> +				    ? safe_crlf
>> +				    : SAFE_CRLF_WARN);
>
> Thanks, 
> Does it makes sense to write it the other way around?
>
> enum safe_crlf crlf_warn = (safe_crlf == SAFE_CRLF_FAIL 
>                            ? SAFE_CRLF_WARN 
>                            : safe_crlf);

I didn't see much difference either way, but between "FAIL needs to be demoted to WARN, everything else goes as-is" and the original "We do not care about anything other than FAIL, so use it as-is, but demote FAIL to WARN", yours look shorter. Will replace.

Previous: Torsten Bögershausen
Message 8 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.