{"thread":{"id":"34393","subject":"Diff colorizer confused by dos newlines","startedAt":"2013-07-09T18:28:32Z","lastAt":"2013-07-09T23:35:54Z","messageCount":3,"participants":["Phillip Susi","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"222944","messageId":"51DC5650.1070708@ubuntu.com","threadId":"34393","inReplyTo":null,"subject":"Diff colorizer confused by dos newlines","fromName":"Phillip Susi","fromEmail":"psusi@ubuntu.com","sentAt":"2013-07-09T18:28:32Z","receivedAt":"2013-07-09T18:28:32Z","isPatch":false,"sender":{"key":"psusi@ubuntu.com","avatar":null},"body":"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\nWhen I try to look at a color diff of a file using dos newlines, the\noutput gets an odd sequence of ansi escapes and a stray carriage\nreturn showing up only on the + lines, but not the -.  The normal\nlooking - lines look like this:\n\n\\r\\n ( from previous line ), ansi color escape, '-', whitespace, text,\nterminating ansi escpae ( [m ), \\r\\n.\n\nThe broken + lines look like this:\n\n\\r\\n ( from previous line ), ansi color sequence, '+', terminating\nansi escape ( [m ), whitespace, ansi color sequence, text, terminating\nansi escape, ansi color sequence, stray \\r, terminating ansi escape, \\n.\n\nAny suggestions on how to resolve this?\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v2.0.17 (MingW32)\nComment: Using GnuPG with Thunderbird - http://www.enigmail.net/\n\niQEcBAEBAgAGBQJR3FZQAAoJEJrBOlT6nu75mvIIAKVKcK2GeVNHKRBkkljqE1U5\n2piftz+CO6sVZGba8DUxMdbA5tCDQrz11yzowuKXDtyr1hxhgjBoXcsN36RZhYdu\ngijE6qF5w/na6MdPgJ7LMizHo8xOeVGhrDr+qhM/5nD77rVumtEnGAdoEqdY+uY3\nmYfHaz2dHAG3W7mOlfvycb4HhRBao64pGh5JnuyvvnZKSXkOyJozjzTEzC7tuNU8\nb9qofVKnTMse7Ek6jGp64GNaxxtcQCt1J8cd2uOJtROUK2g9KgVhy2QSRFqoZ1yO\nzEtTD28bj7nWJubsgVyOdtx0ClxiO1RHQRqQH2/zQM6NlfntAljD15bHcPNJaKo=\n=g3R+\n-----END PGP SIGNATURE-----\n"},{"id":"222955","messageId":"20130709194132.GD5153@sigill.intra.peff.net","threadId":"34393","inReplyTo":"51DC5650.1070708@ubuntu.com","subject":"Re: Diff colorizer confused by dos newlines","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-07-09T19:41:32Z","receivedAt":"2013-07-09T19:41:32Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Jul 09, 2013 at 02:28:32PM -0400, Phillip Susi wrote:\n\n> When I try to look at a color diff of a file using dos newlines, the\n> output gets an odd sequence of ansi escapes and a stray carriage\n> return showing up only on the + lines, but not the -.  The normal\n> looking - lines look like this:\n> \n> \\r\\n ( from previous line ), ansi color escape, '-', whitespace, text,\n> terminating ansi escpae ( [m ), \\r\\n.\n> \n> The broken + lines look like this:\n> \n> \\r\\n ( from previous line ), ansi color sequence, '+', terminating\n> ansi escape ( [m ), whitespace, ansi color sequence, text, terminating\n> ansi escape, ansi color sequence, stray \\r, terminating ansi escape, \\n.\n\nThat's intentional; the added lines go through the \"whitespace checker\"\nto help you identify potential whitespace problems (there is not much\npoint showing them on lines going away, since you are getting rid of\nthem).\n\n> Any suggestions on how to resolve this?\n\nTry:\n\n  git config core.whitespace cr-at-eol\n\nSee the description of \"core.whitespace\" in \"git help config\" for more\ndetails.\n\n-Peff\n"},{"id":"222983","messageId":"51DC9E5A.8000906@ubuntu.com","threadId":"34393","inReplyTo":"20130709194132.GD5153@sigill.intra.peff.net","subject":"Re: Diff colorizer confused by dos newlines","fromName":"Phillip Susi","fromEmail":"psusi@ubuntu.com","sentAt":"2013-07-09T23:35:54Z","receivedAt":"2013-07-09T23:35:54Z","isPatch":false,"sender":{"key":"psusi@ubuntu.com","avatar":null},"body":"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\nOf course!  Thanks, now it completely makes sense.\n\nOn 07/09/2013 03:41 PM, Jeff King wrote:\n> On Tue, Jul 09, 2013 at 02:28:32PM -0400, Phillip Susi wrote:\n> \n>> When I try to look at a color diff of a file using dos newlines,\n>> the output gets an odd sequence of ansi escapes and a stray\n>> carriage return showing up only on the + lines, but not the -.\n>> The normal looking - lines look like this:\n>> \n>> \\r\\n ( from previous line ), ansi color escape, '-', whitespace,\n>> text, terminating ansi escpae ( [m ), \\r\\n.\n>> \n>> The broken + lines look like this:\n>> \n>> \\r\\n ( from previous line ), ansi color sequence, '+',\n>> terminating ansi escape ( [m ), whitespace, ansi color sequence,\n>> text, terminating ansi escape, ansi color sequence, stray \\r,\n>> terminating ansi escape, \\n.\n> \n> That's intentional; the added lines go through the \"whitespace\n> checker\" to help you identify potential whitespace problems (there\n> is not much point showing them on lines going away, since you are\n> getting rid of them).\n> \n>> Any suggestions on how to resolve this?\n> \n> Try:\n> \n> git config core.whitespace cr-at-eol\n> \n> See the description of \"core.whitespace\" in \"git help config\" for\n> more details.\n> \n> -Peff\n> \n\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1.4.12 (GNU/Linux)\nComment: Using GnuPG with Thunderbird - http://www.enigmail.net/\n\niQEcBAEBAgAGBQJR3J5IAAoJEJrBOlT6nu757gIIAMx+w7oCXZt66z57VhZi2yl0\nPmL1HKGQ9+aqerwBtcOFvQL+b8s8o0nLUg3jkHWUFLdEtTIsLSlEwyJBhCzbWQQh\nNzzuwtzGdoXWxj8lFf1PakLRpWg0IW0QJ6WuMltEZMvPvF4jyt3yCArS0StpZEG/\nPhQoEsgg8XjgvP6KIpZDc/CoElKn0fyWf0HlLFwV+k+cCgQM+y7POnGdzGwKIM+O\nU5QJxWZmNFuznJHxkd+YWIsAZuHS/eH4Tz97/Abl9z30k+/4eHvD/Hd47RCTLrC1\n90IiBKp9vvPWJHA+6c1WTwiTnn54CpudKstB499aaMRsvXBzXHcdD+Tkb38imwI=\n=WMkZ\n-----END PGP SIGNATURE-----\n"}]}