git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* Diff colorizer confused by dos newlines
@ 2013-07-09 18:28 Phillip Susi
  2013-07-09 19:41 ` Jeff King
  0 siblings, 1 reply; 3+ messages in thread
From: Phillip Susi @ 2013-07-09 18:28 UTC (permalink / raw)
  To: git

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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.

Any suggestions on how to resolve this?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJR3FZQAAoJEJrBOlT6nu75mvIIAKVKcK2GeVNHKRBkkljqE1U5
2piftz+CO6sVZGba8DUxMdbA5tCDQrz11yzowuKXDtyr1hxhgjBoXcsN36RZhYdu
gijE6qF5w/na6MdPgJ7LMizHo8xOeVGhrDr+qhM/5nD77rVumtEnGAdoEqdY+uY3
mYfHaz2dHAG3W7mOlfvycb4HhRBao64pGh5JnuyvvnZKSXkOyJozjzTEzC7tuNU8
b9qofVKnTMse7Ek6jGp64GNaxxtcQCt1J8cd2uOJtROUK2g9KgVhy2QSRFqoZ1yO
zEtTD28bj7nWJubsgVyOdtx0ClxiO1RHQRqQH2/zQM6NlfntAljD15bHcPNJaKo=
=g3R+
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Diff colorizer confused by dos newlines
  2013-07-09 18:28 Diff colorizer confused by dos newlines Phillip Susi
@ 2013-07-09 19:41 ` Jeff King
  2013-07-09 23:35   ` Phillip Susi
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff King @ 2013-07-09 19:41 UTC (permalink / raw)
  To: Phillip Susi; +Cc: git

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Diff colorizer confused by dos newlines
  2013-07-09 19:41 ` Jeff King
@ 2013-07-09 23:35   ` Phillip Susi
  0 siblings, 0 replies; 3+ messages in thread
From: Phillip Susi @ 2013-07-09 23:35 UTC (permalink / raw)
  To: Jeff King; +Cc: git

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Of course!  Thanks, now it completely makes sense.

On 07/09/2013 03:41 PM, Jeff King wrote:
> 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-----

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-07-09 23:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-09 18:28 Diff colorizer confused by dos newlines Phillip Susi
2013-07-09 19:41 ` Jeff King
2013-07-09 23:35   ` Phillip Susi

git@vger.kernel.org list mirror (unofficial, one of many)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ https://public-inbox.org/git \
		git@vger.kernel.org
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/inbox.comp.version-control.git
	nntp://ie5yzdi7fg72h7s4sdcztq5evakq23rdt33mfyfcddc5u3ndnw24ogqd.onion/inbox.comp.version-control.git
	nntp://4uok3hntl7oi7b4uf4rtfwefqeexfzil2w6kgk2jn5z2f764irre7byd.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git