Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

Re: [RFD] Strange patch formats (aka tricks with unified diffs)..

From: Jeff King <hidden>
Date: 2016-06-15 22:43:04

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help