Context diffs in diff (was grep replacement)

Brian Matthews blm at cxsea.UUCP
Wed Jun 15 02:23:25 AEST 1988


Doug Gwyn (VLD/VMB) <gwyn> (gwyn at 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 at cxsea.UUCP   ...{mnetor,uw-beaver!ssc-vax}!cxsea!blm
+1 206 251 6811    Computer X Inc. - a division of Motorola New Enterprises



More information about the Comp.unix.wizards mailing list