[Top][All Lists]

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

Diffing reformatted code

From: Eric Siegerman
Subject: Diffing reformatted code
Date: Tue, 29 Oct 2002 14:30:33 -0500
User-agent: Mutt/1.2.5i

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.

  - 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.        address@hidden
|  |  /
The acronym for "the powers that be" differs by only one letter
from that for "the pointy-haired boss".

Attachment: wdiff
Description: Text document

reply via email to

[Prev in Thread] Current Thread [Next in Thread]