OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / gnumaniak / original / man1 / diff3.1
1 .\" You may copy, distribute and modify under the terms of the LDP General
2 .\" Public License as specified in the LICENSE file that comes with the
3 .\" gnumaniak distribution
4 .\"
5 .\" The author kindly requests that no comments regarding the "better"
6 .\" suitability or up-to-date notices of any info documentation alternative
7 .\" is added without contacting him first.
8 .\"
9 .\" (C) 2002 Ragnar Hojland Espinosa <ragnar@ragnar-hojland.com>
10 .\"
11 .\"     GNU diff3 man page
12 .\"     man pages are NOT obsolete!
13 .\"     <ragnar@ragnar-hojland.com>
14 .TH DIFF3 1 "October 2002" "GNU diff Utilities 2.8.1"
15 .SH NAME
16 \fBdiff3\fP \- find differences between three files
17 .SH SYNOPSIS
18 .B diff3
19 [\fB\-3aeimxAETX\fP] [\fB-L\fP \fILABEL\fR] [\fB\-\-easy\-only\fP] [\fB\-\-ed\fP]
20 [\fB\-\-initial\-tab\fR] [\fB\-\-label=\fILABEL\fR] [\fB\-\-merge\fP]
21 [\fB\-\-overlap\-only\fP] [\fB\-\-show\-all\fP] [\fB\-\-show\-overlap\fP]
22 [\fB\-\-text\fP] \fIMINE OLDER YOUR
23
24 .B diff3
25 [\fB\-v\fP] [\fB\-\-help\fP] [\fB\-\-version\fP]
26 .SH DESCRIPTION
27 .B diff3
28 compares three files and outputs descriptions
29 of their differences.
30
31 The files to compare are
32 .IR MINE ,
33 .IR OLDER ,
34 and
35 .IR YOURS .
36 At most one of these three file names may be
37 .RB ` \- ',
38 which tells
39 .B diff3
40 to read the standard input for that file.
41
42 Normally \fBdiff3\fP invokes \fBdiff\fP(1) to do its work, but you can
43 change the program by setting the \fBDIFF\fP environment variable to the
44 name of other program.
45 .SH OPTIONS
46 .TP
47 .B \-3, \-\-easy\-only
48 Like
49 .BR \-e ,
50 except output only the nonoverlapping changes.
51 .TP
52 .B \-a, \-\-text
53 Treat all files as text and compare them line-by-line, even if they
54 do not appear to be text.
55 .TP
56 .B \-e, \-\-ed
57 Generate an
58 .I ed
59 script that incorporates all the changes from
60 .I OLDER
61 to
62 .I YOURS
63 into
64 .IR MINE .
65 .TP
66 .B \-i
67 Generate `\fBw\fP' and `\fBq\fP' commands at the end of the
68 .B ed
69 script for System V compatibility.  This option must be combined with
70 one of the
71 .B \-AeExX3
72 options, and may not be combined with
73 .BR \-m .
74 .TP
75 .B \-m, -\-merge
76 Apply the edit script to the first file and send the result to standard
77 output.  Unlike piping the output from \fBdiff3\fP to \fBed\fP
78 this works even for binary files and incomplete lines. \fB\-A\fP is assumed
79 if no edit script option is specified. 
80 .TP
81 .B \-x, \-\-overlap\-only
82 Like
83 .BR \-e ,
84 except output only the overlapping changes.
85 .TP
86 .B \-A, \-\-show\-all
87 Incorporate all changes from
88 .I OLDER
89 to
90 .I YOURS
91 into
92 .IR MINE ,
93 surrounding all overlapping changes with bracket lines.
94 .TP
95 .B \-E, \-\-show\-overlap
96 Like
97 .BR \-e ,
98 except bracket lines from overlapping changes' first
99 and third files.  With
100 .BR \-e ,
101 an overlapping change looks like this:
102 .sp
103 .nf
104 <<<<<<< \fIMINE\fP
105 lines from \fIMINE\fP
106 =======
107 lines from \fIYOURS\fP
108 >>>>>>> \fIYOURS\fP
109 .fi
110 .TP
111 .BI "\-L " LABEL ", \-\-label=" LABEL
112 Use the label
113 .I LABEL
114 for the brackets output by the
115 \fB\-A\fP, \fB\-E\fP and \fB\-X\fP options.  This option may be given up to
116 three 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 \-T, \-\-initial\-tab
135 Output a tab rather than two spaces before the text of a line in normal format.
136 This causes the alignment of tabs in the line to look normal.
137 .TP
138 .B \-X
139 Like \fB\-E\fP, except output only the overlapping changes.  In other words,
140 like \fB\-x\fP, except bracket changes as in \fB\-E\fP.
141 .TP
142 .B "\-\-help"
143 Print a usage message on standard output and exit successfully.
144 .TP
145 .B \-v, \-\-version
146 Output the version number of
147 .BR diff3 .
148 .SH OUTPUT FORMAT
149 Each hunk begins with a line marked `\fB====\fP'.  Three-way hunks have
150 plain `\fB====\fP' lines, and two-way hunks have 
151 .RB ` 1 "', " 2 "', or `" 3 ' 
152 appended to specify which of the three input files differ in that hunk.  The
153 hunks contain copies of two or three sets of input lines each preceded by one
154 or two commands identifying where the lines came from.  The default behaviour
155 is to precede input lines with two spaces to distinguish them from the 
156 commands.  If `\fB-T\fP' is specified then \fBdiff3\fP uses a tab instead, 
157 lining up any other tabs correctly.
158 .SS Command forms
159 .TP
160 .IB FILE : L a
161 This hunk appears after line \fIL\fP of \fIFILE\fP, and contains no lines
162 in that file.  To edit this file to yield the other files, one
163 must append hunk lines taken from the other files.  For example,
164 `1:11a' means that the hunk follows line 11 in the
165 first file and contains no lines from that file.
166 .TP
167 .IB FILE : R c
168 This hunk contains the lines in the range \fIR\fP of \fIFILE\fP.  The
169 range \fIR\fP is a comma-separated pair of line numbers, or just one
170 number if the range is a singleton.  To edit this file
171 to yield the other files, one must change the specified lines to be the lines
172 taken from the other files.  For example, `2:11,13c' means that
173 the hunk contains lines 11 through 13 from the second file.
174 .sp
175 If the last line in a set of input lines is incomplete it is distinguished
176 on output from a full line by a following line that starts with `\fB\\\fP'.
177 .SH DIAGNOSTICS
178 .B diff3
179 exits with one of the following values:
180 .TP
181 .B 0
182 \fBdiff3\fR was successful, no overlapping changes (conflicts) found.
183 .TP
184 .B 1
185 Some conflict was found.
186 .TP
187 .B 2
188 Some error occurred.
189 .SH SEE ALSO
190 cmp(1), comm(1), diff(1), ed(1), patch(1), sdiff(1).
191 .SH NOTES
192 Report bugs to bug-gnu-utils@gnu.org.
193 Page updated by Ragnar Hojland Espinosa <ragnar@ragnar-hojland.com>