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

Re: Bug: Problem with CRLF line ending in git-diff with coloring

From
Johannes Sixt <j6t@kdbg.org>
Date
Feb 9, 2014, 18:30 UTC
Message-ID
<52F7C956.5040604@kdbg.org>
In-Reply-To
<20140209110155.GB16189@scotty.home>
Am 09.02.2014 12:01, schrieb Stefan-W. Hahn:
Show 5 quoted lines
> Good morning,
> 
> when diffing output where files have CRLF line ending, the coloring
> seems wrong, because in changed lines the CR (^M) is highlighted,
> even if the line ending has not changed.
...
> If WS_CR_AT_EOL is set in ecbdata->ws_rule, it works correctly, but this seems
> not the right solutions.

It's the right solution. IOW, you should place something like this in your .gitattributes:

  *.html whitespace=cr-at-eol
-- Hannes
Previous: Stefan-W. HahnNext: Stefan-W. Hahn
Message 2 of 6 in “Bug: Problem with CRLF line ending in git-diff with coloring”
  1. Stefan-W. HahnFeb 9, 2014
  2. Johannes SixtFeb 9, 2014
  3. Stefan-W. HahnFeb 14, 2014
  4. Johannes SixtFeb 14, 2014
  5. Stefan-W. HahnFeb 15, 2014
  6. Stefan-W. HahnFeb 14, 2014

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.