On Tue, Oct 29, 2002 at 10:28:25AM -0800, Shankar Unni wrote:
> In any case, I'll take a closer look at the CVSNT stuff (I wish they
> hadn't gone and reformatted all their sources so much :-/), and see
> what's portable back to the main line..
GNU wdiff might be useful. It's a diff that's word-based instead
of line-based. It was intended for filled text, and I've only
ever used it for that, but it *might* produce readable diff's of
code. Even if the sections containing differences are
confusingly jumbled in its output, at least it'll show you where
the differences are, so you can skip past sections that are
token-for-token identical.
Hint:
- By default, wdiff marks diffs by inserting [-silly-]
{+special-character+} sequences that I find hard to read.
I've had much better luck by making it use different colours
or font attributes for the "removed" and "inserted" text.
See the attached trivial wrapper script, but you'll probably
have to change the specific escape sequences, or better yet,
termcapize it.
Corollaries, when using the wrapper:
- If your terminal is vaguely ANSI-like (as xterms are)
searching for an ASCII <ESC> character is a good way to
"seek" to the next difference section.
- "less -rG" is your friend, even if wdiff's output confuses it
such that the colourization is sometimes messed up near the
top of the screen; scrolling up a line or two, and/or hitting
CTRL-L a couple of times, usually clears it up...
--
| | /\
|-_|/ > Eric Siegerman, Toronto, Ont. [EMAIL PROTECTED]
| | /
The acronym for "the powers that be" differs by only one letter
from that for "the pointy-haired boss".
#!/bin/sh
WDIFF=$HOME/dist/bin/wdiff
COLOURS='--start-insert=[;1m --end-insert=[m --start-delete=[;4m --end-delete=[m'
[ "x$1" = "x-c" ] && {
COLOURS=
shift
}
exec $WDIFF $COLOURS ${1+"$@"}