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

Re: Diff colorizer confused by dos newlines

From
PSPhillip Susi <psusi@ubuntu.com>
Date
Jul 9, 2013, 23:35 UTC
Message-ID
<51DC9E5A.8000906@ubuntu.com>
In-Reply-To
<20130709194132.GD5153@sigill.intra.peff.net>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Of course!  Thanks, now it completely makes sense.
On 07/09/2013 03:41 PM, Jeff King wrote:
Show 33 quoted lines
> On Tue, Jul 09, 2013 at 02:28:32PM -0400, Phillip Susi wrote:
> 
>> When I try to look at a color diff of a file using dos newlines,
>> the output gets an odd sequence of ansi escapes and a stray
>> carriage return showing up only on the + lines, but not the -.
>> The normal looking - lines look like this:
>> 
>> \r\n ( from previous line ), ansi color escape, '-', whitespace,
>> text, terminating ansi escpae ( [m ), \r\n.
>> 
>> The broken + lines look like this:
>> 
>> \r\n ( from previous line ), ansi color sequence, '+',
>> terminating ansi escape ( [m ), whitespace, ansi color sequence,
>> text, terminating ansi escape, ansi color sequence, stray \r,
>> terminating ansi escape, \n.
> 
> That's intentional; the added lines go through the "whitespace
> checker" to help you identify potential whitespace problems (there
> is not much point showing them on lines going away, since you are
> getting rid of them).
> 
>> Any suggestions on how to resolve this?
> 
> Try:
> 
> git config core.whitespace cr-at-eol
> 
> See the description of "core.whitespace" in "git help config" for
> more details.
> 
> -Peff
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJR3J5IAAoJEJrBOlT6nu757gIIAMx+w7oCXZt66z57VhZi2yl0 PmL1HKGQ9+aqerwBtcOFvQL+b8s8o0nLUg3jkHWUFLdEtTIsLSlEwyJBhCzbWQQh NzzuwtzGdoXWxj8lFf1PakLRpWg0IW0QJ6WuMltEZMvPvF4jyt3yCArS0StpZEG/ PhQoEsgg8XjgvP6KIpZDc/CoElKn0fyWf0HlLFwV+k+cCgQM+y7POnGdzGwKIM+O U5QJxWZmNFuznJHxkd+YWIsAZuHS/eH4Tz97/Abl9z30k+/4eHvD/Hd47RCTLrC1 90IiBKp9vvPWJHA+6c1WTwiTnn54CpudKstB499aaMRsvXBzXHcdD+Tkb38imwI= =WMkZ -----END PGP SIGNATURE-----

Previous: Jeff King
Message 3 of 3 in “Diff colorizer confused by dos newlines”
  1. Phillip SusiJul 9, 2013
  2. Jeff KingJul 9, 2013
  3. Phillip SusiJul 9, 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.