[comp.sources.wanted] Patch - context diffs

croes@imec.be (Kris Croes) (01/09/90)

Hello again,

I am also looking for a way to generate these "context diffs"
to be fed into the famous PATCH program.

Is there a program to generate these, or is it some option
to another program (patch itself, or diff, or...) 
PS: if RTFM'ed these manuals and found nothing about it.

Kris

-- 
--------
K. CROES - IMEC - Leuven - Belgium   croes@imec.be

The Demon King bites in your leg and you feel weaker.

frotz@drivax.UUCP (Frotz) (01/16/90)

croes@imec.be (Kris Croes) writes:

] Hello again,

] I am also looking for a way to generate these "context diffs"
] to be fed into the famous PATCH program.

] Is there a program to generate these, or is it some option
] to another program (patch itself, or diff, or...) 
] PS: if RTFM'ed these manuals and found nothing about it.

Look at the diff(1) manpage.

NOTE: There is a trick to the order in which the files are diffed. 

When merging with other people's source (mine being considered the
baseline, their's considered derivative), I create temporary directory
and place their derivative sources in it.  Then, I run diff (I use
GNU's Diff because they have an optimized context diff, which is
generally better, though not always) with the following DOS command:

	DOS_3_3_Prompt> for %i in (*.c *.h) do rdiff -c %i tmp/%i >> diffs

or
	csh> foreach f (*.[ch])
	? diff -c $f tmp/$f >> diffs
	? end

Then I edit the file 'diffs' and weed out any differences that I don't
want to have patched into my sources. 

NOTE: My additions tend to be removed (subtracted with '-' signs) from
the patch while the derivative source is added (via '+' signs).  This
makes much more sense to me, but I also have not found any hard and
fast rules for doing this. 

--Frotz @Digital Research, Incorporated		amdahl!drivax!frotz
	 70 Garden Court, B15			(408) 649-3896
	 Monterey, California  93940		Ask for John Fa'atuai

guy@auspex.auspex.com (Guy Harris) (01/17/90)

>] I am also looking for a way to generate these "context diffs"
>] to be fed into the famous PATCH program.
>
>Look at the diff(1) manpage.

In which case you may not find any "-c" flag mentioned, if you're not
running a system whose "diff" has that option.  Not all systems do.

If your "diff" doesn't, there are a number of alternatives:

	1) get GNU "diff", which I think has "-c";

	2) get a program that I think exists somewhere in some source
	   archive, which acts as a "front end" to a "diff" without "-c"
	   and produces context "diff" output;

	3) if you have 4.xBSD source handy, build its "diff" for your
	   system.