[comp.unix.wizards] Context diffs in diff

blm@cxsea.UUCP (Brian Matthews) (06/14/88)

Doug Gwyn (VLD/VMB) <gwyn> (gwyn@brl.arpa) writes:
|Removing the ability to get context diffs when they are wanted WOULD
|be a bad idea.  Removing this feature from "diff" itself is not a
|bad idea; I hate for "diff" to do extra work every time I run it when
|I virtually never use the context feature.  Consider
|	diff a b | diffc a b
|where "diffc" reads the "diff" information in parallel with the two
|files "a" and "b" to produce the context-diff output.  By separating
|the two functions, it is not only likely to speed up non-context use
|of "diff" but also it is more likely to get the answer right, and it
|is easier to work on improving "diffc".  (Existing context diff output
|is sometimes pretty horrible, for example larger than the inputs.)

In general I agree, the problem I have using diffc (I'm running System V
and use diffc quite regularly) is that one of it's arguments can't be
stdin.  You could fix diffc to copy its input to a temporary file, but
you still couldn't do something like
	diff - b | diffc - b
(and generate a context diff of stdin and file b).


-- 
Brian L. Matthews  blm@cxsea.UUCP   ...{mnetor,uw-beaver!ssc-vax}!cxsea!blm
+1 206 251 6811    Computer X Inc. - a division of Motorola New Enterprises

haugj@pigs.UUCP (The Beach Bum) (06/17/88)

In article <2418@cxsea.UUCP>, blm@cxsea.UUCP (Brian Matthews) writes:
> In general I agree, the problem I have using diffc (I'm running System V
> and use diffc quite regularly) is that one of it's arguments can't be
> stdin.

There is a version of diffc which will produce a context diff using
stdin as one file.  Or at least it did the last time I checked.  It
was posted late last fall or winter and should be in Volume 13 or 14
of the comp.unix.sources archive.

- John.
-- 
 The Beach Bum                                 Big "D" Home for Wayward Hackers
 UUCP: ...!killer!rpp386!jfh                          jfh@rpp386.uucp :SMAILERS

 "You are in a twisty little maze of UUCP connections, all alike" -- fortune