Git development
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <junkio@cox.net>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: [RFD] Strange patch formats (aka tricks with unified diffs)..
Date: Sat, 14 Apr 2007 06:09:23 -0400	[thread overview]
Message-ID: <20070414100923.GA6546@sigill.intra.peff.net> (raw)
In-Reply-To: <7vbqhrb7r2.fsf@assigned-by-dhcp.cox.net>

On Sat, Apr 14, 2007 at 02:55:13AM -0700, Junio C Hamano wrote:

> One sensible behaviour would be to show exactly the same output
> lines as the regular output, but color-code only the words that
> changed.  E.g (the words are capitalized to illustrate instead
> of colored here):

That works great for highlighting a small change between two very
similar lines (and I think that is one use of --color-words). However,
it's terrible for the other use of color words, which is showing changes
which are not well-adapted to line oriented diffs (such as flowed text).

Try this:

cat >orig <<EOF
this is a paragraph that has
some text in it and is wrapped
at 30 characters
EOF

cat >rewrapped <<EOF
this is yet another paragraph
that has some text in it and
is wrapped at 30 characters
EOF

git-diff --color orig rewrapped
git-diff --color-words orig rewrapped


I think one behavior is best for one situation, and the other behavior
for another situation. Perhaps there is room for two modes?

-Peff

  reply	other threads:[~2007-04-14 10:09 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-12 21:58 [RFD] Strange patch formats (aka tricks with unified diffs) Linus Torvalds
2007-04-12 23:02 ` Junio C Hamano
2007-04-13  5:38 ` Marco Costalba
2007-04-17 18:02   ` Marco Costalba
2007-04-13  5:43 ` Paul Mackerras
2007-04-13  6:07   ` Martin Langhoff
2007-04-13  6:35     ` Junio C Hamano
2007-04-13  7:01       ` Martin Langhoff
2007-04-14  8:59       ` Johannes Schindelin
2007-04-14  9:55         ` Junio C Hamano
2007-04-14 10:09           ` Jeff King [this message]
2007-04-13 15:16   ` Linus Torvalds
2007-04-18  1:44     ` Paul Mackerras
2007-04-18  4:02       ` Linus Torvalds
2007-04-13  8:10 ` Matthias Lederhofer
2007-04-13 15:00   ` Linus Torvalds

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

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

  git send-email \
    --in-reply-to=20070414100923.GA6546@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox