Initial import from FreeBSD RELENG_4:
[dragonfly.git] / gnu / usr.bin / diff3 / diff3.1
1 .TH DIFF3 1 "22sep1993" "GNU Tools" "GNU Tools"
2 .SH NAME
3 diff3 \- find differences between three files
4 .SH SYNOPSIS
5 .B diff3
6 [options] mine older yours
7 .SH DESCRIPTION
8 The
9 .I diff3
10 command compares three files and outputs descriptions
11 of their differences.
12
13 The files to compare are
14 .IR mine ,
15 .IR older ,
16 and
17 .IR yours .
18 At most one of these three file names may be
19 .BR \- ,
20 which tells
21 .I diff3
22 to read the standard input for that file.
23 .SS Options
24 Below is a summary of all of the options that GNU
25 .I diff3
26 accepts.  Multiple single letter options (unless they take an argument)
27 can be combined into a single command line argument.
28 .TP
29 .B \-a
30 Treat all files as text and compare them line-by-line, even if they
31 do not appear to be text.
32 .TP
33 .B \-A
34 Incorporate all changes from
35 .I older
36 to
37 .I yours
38 into
39 .IR mine ,
40 surrounding all conflicts with bracket lines.
41 .TP
42 .B \-B
43 Old behavior of -A.  Shows non-conflicts.
44 .TP
45 .B \-e
46 Generate an
47 .I ed
48 script that incorporates all the changes from
49 .I older
50 to
51 .I yours
52 into
53 .IR mine .
54 .TP
55 .B \-E
56 Like
57 .BR \-e ,
58 except bracket lines from overlapping changes' first
59 and third files.
60 With
61 .BR \-e ,
62 an overlapping change looks like this:
63 .sp
64 .nf
65 <<<<<<< \fImine\fP
66 lines from \fImine\fP
67 =======
68 lines from \fIyours\fP
69 >>>>>>> \fIyours\fP
70 .fi
71 .TP
72 .B \-\-ed
73 Generate an
74 .I ed
75 script that incorporates all the changes from
76 .I older
77 to
78 .I yours
79 into
80 .IR mine .
81 .TP
82 .B \-\-easy\-only
83 Like
84 .BR \-e ,
85 except output only the nonoverlapping changes.
86 .TP
87 .B \-i
88 Generate
89 .B w
90 and
91 .B q
92 commands at the end of the
93 .I ed
94 script for System V compatibility.  This option must be combined with
95 one of the
96 .B \-AeExX3
97 options, and may not be combined with
98 .BR \-m .
99 .TP
100 .B \-\-initial\-tab
101 Output a tab rather than two spaces before the text of a line in normal format.
102 This causes the alignment of tabs in the line to look normal.
103 .TP
104 .BI "\-L " label
105 .ns
106 .TP
107 .BI \-\-label= label
108 Use the label
109 .I label
110 for the brackets output by the
111 .BR \-A ,
112 .B \-E
113 and
114 .B \-X
115 options.  This option may be given up to three
116 times, one for each input file.  The default labels are the names of
117 the input files.  Thus
118 .B "diff3 \-L X \-L Y \-L Z \-m A B C"
119 acts like
120 .BR "diff3 \-m A B C ,
121 except that the output looks like it came from
122 files named
123 .BR X ,
124 .B Y
125 and
126 .B Z
127 rather than from files
128 named
129 .BR A ,
130 .B B
131 and
132 .BR C .
133 .TP
134 .B \-m
135 .br
136 .ns
137 .TP
138 .B \-\-merge
139 Apply the edit script to the first file and send the result to standard
140 output.  Unlike piping the output from
141 .I diff3
142 to
143 .IR ed ,
144 this
145 works even for binary files and incomplete lines.
146 .B \-A
147 is assumed
148 if no edit script option is specified.
149 .TP
150 .B \-\-overlap\-only
151 Like
152 .BR \-e ,
153 except output only the overlapping changes.
154 .TP
155 .B \-\-show\-all
156 Incorporate all unmerged changes from
157 .I older
158 to
159 .I yours
160 into
161 .IR mine ,
162 surrounding all overlapping changes with bracket lines.
163 .TP
164 .B \-\-show\-overlap
165 Like
166 .BR \-e ,
167 except bracket lines from overlapping changes' first
168 and third files.
169 .TP
170 .B \-T
171 Output a tab rather than two spaces before the text of a line in normal format.
172 This causes the alignment of tabs in the line to look normal.
173 .TP
174 .B \-\-text
175 Treat all files as text and compare them line-by-line, even if they
176 do not appear to be text.
177 .TP
178 .B \-v
179 .br
180 .ns
181 .TP
182 .B \-\-version
183 Output the version number of
184 .IR diff3 .
185 .TP
186 .B \-x
187 Like
188 .BR \-e ,
189 except output only the overlapping changes.
190 .TP
191 .B \-X
192 Like
193 .BR \-E ,
194 except output only the overlapping changes.
195 In other words, like
196 .BR \-x ,
197 except bracket changes as in
198 .BR \-E .
199 .TP
200 .B \-3
201 Like
202 .BR \-e ,
203 except output only the nonoverlapping changes.
204 .SH SEE ALSO
205 cmp(1), comm(1), diff(1), ed(1), patch(1), sdiff(1).
206 .SH DIAGNOSTICS
207 An exit status of 0 means
208 .I diff3
209 was successful, 1 means some
210 conflicts were found, and 2 means trouble.