BSD 4_4_Lite2 development
[unix-history] / usr / share / man / cat1 / diff3.0
DIFF3(1) BSD Reference Manual DIFF3(1)
N\bNA\bAM\bME\bE
d\bdi\bif\bff\bf3\b3 - 3-way differential file comparison
S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
d\bdi\bif\bff\bf3\b3 [-\b-e\bex\bxE\bEX\bX3\b3] _\bf_\bi_\bl_\be_\b1 _\bf_\bi_\bl_\be_\b2 _\bf_\bi_\bl_\be_\b3
D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
The d\bdi\bif\bff\bf3\b3 utility compares the contents of three different versions of a
file, _\bf_\bi_\bl_\be_\b1, _\bf_\bi_\bl_\be_\b2 and _\bf_\bi_\bl_\be_\b3, writing the result to the standard output.
The options describe different methods of merging and purging the sepa-
rate versions into a new file. D\bDi\bif\bff\bf3\b3 is used by RCS(1) to merge specific
versions or create new versions.
Options are:
-\b-e\be Produces output in a form suitable as an input script for the
ed(1) utility. The script may then be used to merge differ-
ences common between all three files and differences specific
to file1 and file3. In other words, the -\b-e\be option ignores dif-
ferences specific to file1 and file2, and those specific to
file2 and file3. It is useful for backing out changes specific
to file2 only.
-\b-x\bx Produces an output script suitable for ed(1) with changes spe-
cific only to all three versions.
-\b-3\b3 Produces an output script suitable for ed(1) with changes spe-
cific only to file3.
-\b-E\bE, -\b-X\bX Similar to -\b-e\be and -\b-x\bx, respectively, but treat overlapping
changes (i.e., changes that would be noted with ==== in the
normal listing) differently. The overlapping lines from both
files will be inserted by the edit script, bracketed by
"<<<<<<" and ">>>>>>" lines.
The -\b-E\bE option is used by RCS merge(1) to insure that overlapping changes
in the merged files are preserved and brought to someone's attention.
For example, suppose lines 7-8 are changed in both file1 and file2. Ap-
plying the edit script generated by the command
diff3 -E file1 file2 file3
to file1 results in the file:
lines 1-6
of file1
<<<<<<< file1
lines 7-8
of file1
=======
lines 7-8
of file3
>>>>>>> file3
rest of file1
The default output of d\bdi\bif\bff\bf3\b3 makes notation of the differences between all
files, and those differences specific to each pair of files. The changes
are described by the commands necessary for ed(1) to create the desired
target from the different versions. See diff(1) for a description of the
commands.
==== The lines beneath this notation are ranges of lines which are dif-
ferent between all files.
====_\bn The lines beneath this notation are ranges of lines which are ex-
clusively different in file _\bn.
F\bFI\bIL\bLE\bES\bS
/tmp/d3????? temporary files.
/usr/bin/diff3 the executable.
S\bSE\bEE\bE A\bAL\bLS\bSO\bO
diff(1) ed(1) rcs(1)
B\bBU\bUG\bGS\bS
The -\b-e\be option cannot catch and change lines which have `.' as the first
and only character on the line. The resulting script will fail on that
line as `.' is an ed(1) editing command.
H\bHI\bIS\bST\bTO\bOR\bRY\bY
A d\bdi\bif\bff\bf3\b3 command appeared in Version 7 AT&T UNIX.
4.3-Reno Berkeley Distribution April 18, 1994 2