[comp.sources.d] A fun little burrowing diff

allbery@ncoast.UUCP (Brandon Allbery) (12/26/87)

As quoted from <322@gauss.rutgers.edu> by linhart@gauss.rutgers.edu (D-ro 3):
+---------------
| In article <12253@sci.UUCP> richd@sci.UUCP (Rich doherty) writes:
| >1) I have no idea the "right" way to diff, having never used patch
| >   or any other net programs designed to make such things easy.
| >   So it is standard diff(1) output.
| 
| You had the right idea, you just didn't look at the switches.
| The right way to diff is to use the -c switch to make a context
| difference, which changes lines when the lines around it match, rather
| than an ed diff, which changes lines by line number.  An ed diff can
| screw up an already-modified file.  Also, the -b switch will keep diff
| from including lines where you only changed the number of spaces in
| indentations and such.
+---------------

...assuming he's running 4.xBSD instead of System V, Xenix, Microport, V7,
et cetera ad nauseam....

Would someone please post a PD diff which supports -c and -b?  System V has
neither option.  I've got "diffc" on ncoast (converts diff output into diff
-c output), but it still doesn't handle -b and it's the OLD (4.2) diff -c
rather than the NEW (4.3BSD) diff -c.
-- 
	      Brandon S. Allbery, Moderator of comp.sources.misc
 {hoptoad,harvard!necntc,cbosgd,sun!mandrill!hal,uunet!hnsurg3}!ncoast!allbery
     [This space reserved for future quotes and similar brain twisters.]

amos@taux01.UUCP (Amos Shapir) (12/27/87)

In article <6900@ncoast.UUCP> allbery@ncoast.UUCP (Brandon Allbery) writes:
>Would someone please post a PD diff which supports -c and -b?

In the Nov. 85 issue of _Software, Practice and Experience_ there's an
article by Miller & Myers, containing a description of a new algorithm
for diff, including a listing of an implementation in C. (That's supposed
to be faster than the standard one). If any of them is on the net, maybe
they can post it (or anybody else if it's PD - I can't check now).
-- 
	Amos Shapir			(My other cpu is a NS32532)
National Semiconductor (Israel)
6 Maskit st. P.O.B. 3007, Herzlia 46104, Israel  Tel. +972 52 522261
amos%taux01@nsc.com (used to be amos%nsta@nsc.com) 34 48 E / 32 10 N