Re: Diff colorizer confused by dos newlines

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]