Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!pasteur!agate!ig!uwmcsd1!bbn!rochester!cornell!uw-beaver!fluke!ssc-vax!cxsea!blm From: blm@cxsea.UUCP (Brian Matthews) Newsgroups: comp.unix.wizards Subject: Re: Context diffs in diff (was grep replacement) Message-ID: <2418@cxsea.UUCP> Date: 14 Jun 88 16:23:25 GMT References: <144@insyte.UUCP> <3350@phri.UUCP> <8080@brl-smoke.ARPA> Reply-To: blm@cxsea.UUCP (Brian Matthews) Organization: Computer X Inc. Lines: 23 Doug Gwyn (VLD/VMB) (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