[comp.sources.d] RCS merge script ???

rommel@Informatik.TU-Muenchen.DE (Kai-Uwe Rommel) (02/28/91)

I am a bit confused about the merge script of RCS (applies to both 4.3
and 5.5). This shell script is supposed to merge the differences between
file2 and file3 into file1 (three arguments to it), am I right?

Now, I see that this shell script calls diff two times and then calls
diff3 with five arguments: the two files with the output of the previous
two diff calls and the three input files. The output is an ed script and
is piped to ed to apply it to file1.

Can anyone please explain what this means, especially why diff is called
first two times and what diff3 should do with diff's two output files?

If I understood the purpose of merge correctly, I think I can achieve
this by simply calling diff3 -E on the three input files when I have GNU
diff3 and pipe the result to ed. Is this Ok?

Thanks for any hint,
Kai Uwe Rommel

news@ncrwat.Waterloo.NCR.COM (News Administration) (03/04/91)

In article <1991Feb27.200448.14036@newsserv.informatik.tu-muenchen.de> rommel@Informatik.TU-Muenchen.DE (Kai-Uwe Rommel) writes:
>I am a bit confused about the merge script of RCS (applies to both 4.3
>and 5.5). 

RCS (if you have a UNIX source licence) comes with a modified
Berkeley diff3 program, that behaves differently from the normal
diff3, this is the reason for the difference in the number and
type of arguments. Locally, I have used the V.4 diff3, which
appears identical to the GNU diff3. The only thing you have to do
is to remove the 'w' and 'q' commands from the end of the diff3
output. If you like, I'll mail you my merge script.




Tony Lill,                           ajlill@riipsdev.Waterloo.NCR.COM
President, A. J. Lill Consultants                 (519) 650 0660
539 Grand Valley Dr., Cambridge, Ont.             (519) 653 9732
presently at E&M Waterloo, NCR Canada Ltd.        (519) 884 1710 x624

eggert@twinsun.com (Paul Eggert) (03/09/91)

ajlill@riipsdev.Waterloo.NCR.COM (Tony Lill) writes:

>RCS (if you have a UNIX source licence) comes with a modified
>Berkeley diff3 program, that behaves differently from the normal
>diff3, this is the reason for the difference in the number and
>type of arguments. Locally, I have used the V.4 diff3, which
>appears identical to the GNU diff3. The only thing you have to do
>is to remove the 'w' and 'q' commands from the end of the diff3
>output.

This info is a bit out of date.  A long time ago RCS came with its own
copy of diff, but the necessary changes were folded into BSD diff before
4.3BSD.  (No doubt System V did not pick up this improvement until much
later.)  GNU diff3 did not work with RCS until GNU diff 1.15 and RCS 5.5
were published.  RCS 5.5 talks to GNU diff3 and to Unix diff3 in
completely different ways: for GNU it uses diff3's -m option, but for
Unix it uses an undocumented program that is named /usr/lib/diff3 or
/usr/5lib/rdiff3prog or something similar.

guy@auspex.auspex.com (Guy Harris) (03/12/91)

 >This info is a bit out of date.  A long time ago RCS came with its own
 >copy of diff, but the necessary changes were folded into BSD diff before
 >4.3BSD.  (No doubt System V did not pick up this improvement until much
 >later.)

V.4.