git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Phillip Susi <psusi@ubuntu.com>
Cc: git@vger.kernel.org
Subject: Re: Diff colorizer confused by dos newlines
Date: Tue, 9 Jul 2013 15:41:32 -0400	[thread overview]
Message-ID: <20130709194132.GD5153@sigill.intra.peff.net> (raw)
In-Reply-To: <51DC5650.1070708@ubuntu.com>

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

  reply	other threads:[~2013-07-09 19:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-09 18:28 Diff colorizer confused by dos newlines Phillip Susi
2013-07-09 19:41 ` Jeff King [this message]
2013-07-09 23:35   ` Phillip Susi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130709194132.GD5153@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=psusi@ubuntu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).