Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!cica!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!usc!apple!amdahl!drivax!frotz From: frotz@drivax.UUCP (Frotz) Newsgroups: comp.sources.wanted Subject: Re: Patch - context diffs Message-ID: Date: 15 Jan 90 20:56:20 GMT References: <902@imec.UUCP> Sender: frotz@drivax.UUCP Reply-To: frotz@drivax.UUCP Organization: Digital Research, Monterey CA Lines: 39 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