Debian Codegraph @

upstream/debian-unstable/man1/gdiffmk.1

raw
1 .TH gdiffmk 1 "2026-04-22" "groff 1.24.1"
2 .SH Name
3 gdiffmk \- mark differences between
4 .IR groff / nroff / troff
5 files
6 .
7 .
8 .\" ====================================================================
9 .\" Legal Terms
10 .\" ====================================================================
11 .\"
12 .\" Copyright 2004-2016 Free Software Foundation, Inc.
13 .\" 2017-2025 G. Branden Robinson
14 .\"
15 .\" This file is part of gdiffmk.
16 .\"
17 .\" gdiffmk is distributed with groff, the GNU roff typesetting system.
18 .\"
19 .\" groff is free software; you can redistribute it and/or modify it
20 .\" under the terms of the GNU General Public License as published by
21 .\" the Free Software Foundation, either version 3 of the License, or
22 .\" (at your option) any later version.
23 .\"
24 .\" groff is distributed in the hope that it will be useful, but WITHOUT
25 .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
26 .\" or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
27 .\" License for more details.
28 .\"
29 .\" You should have received a copy of the GNU General Public License
30 .\" along with this program. If not, see
31 .\" <http://www.gnu.org/licenses/>.
32 .
33 .
34 .\" Save and disable compatibility mode (for, e.g., Solaris 10/11).
35 .do nr *groff_gdiffmk_1_man_C \n[.cp]
36 .cp 0
37 .
38 .\" Define fallback for groff 1.23's MR macro if the system lacks it.
39 .nr do-fallback 0
40 .if !\n(.f .nr do-fallback 1 \" mandoc
41 .if \n(.g .if !d MR .nr do-fallback 1 \" older groff
42 .if !\n(.g .nr do-fallback 1 \" non-groff *roff
43 .if \n[do-fallback] \{\
44 . de MR
45 . ie \\n(.$=1 \
46 . I \%\\$1
47 . el \
48 . IR \%\\$1 (\\$2)\\$3
49 . .
50 .\}
51 .rr do-fallback
52 .
53 .
54 .\" ====================================================================
55 .SH Synopsis
56 .\" ====================================================================
57 .
58 .SY gdiffmk
59 .RB [ \-a\~\c
60 .IR add-mark ]
61 .RB [ \-c\~\c
62 .IR change-mark ]
63 .RB [ \-d\~\c
64 .IR delete-mark ]
65 .RB [ \-x\~\c
66 .IR diff-command ]
67 .RB [ \-D
68 .RB [ \-B ]
69 .RB [ \-M
70 .IR "mark1 mark2" ]]
71 .RB [ \-\- ]
72 .I file1
73 .I file2
74 .RI [ output-file ]
75 .YS
76 .
77 .
78 .P
79 .SY gdiffmk
80 .B \-\-help
81 .YS
82 .
83 .
84 .P
85 .SY gdiffmk
86 .B \%\-\-version
87 .YS
88 .
89 .
90 .\" ====================================================================
91 .SH Description
92 .\" ====================================================================
93 .
94 .I gdiffmk
95 compares two
96 .MR roff 7
97 documents,
98 .I file1
99 and
100 .IR file2 ,
101 and writes another,
102 derived from both,
103 to the standard output stream
104 (or
105 .IR output-file ),
106 adding margin character
107 .RB ( mc )
108 requests at places in the output
109 where the input documents differ.
110 .
111 .I gdiffmk
112 does not interpret the source documents;
113 it treats
114 .I roff
115 comments and nilpotent changes to formatting as meaningful.
116 .
117 For example,
118 it does not know that
119 .BR \[rs]h\[aq]3m\[aq] ,
120 .BR \[rs]h\[aq](1\~*\~3m)\[aq] ,
121 and
122 .B \[rs]h\[aq]3m+0\[aq]
123 all mean the same thing.
124 .
125 If the
126 .I file1
127 or
128 .I file2
129 argument is
130 .RB \[lq] \- \[rq],
131 .I gdiffmk
132 reads the standard input stream for that input.
133 .
134 If the
135 .I output
136 operand is present,
137 .I gdiffmk
138 writes output to a file of that name.
139 .
140 If it is
141 .RB \[lq] \- \[rq]
142 or absent,
143 .I gdiffmk
144 writes output to the standard output stream.
145 .
146 .RB \[lq] \- \[rq]
147 cannot be both an input and output operand.
148 .
149 .
150 .\" ====================================================================
151 .SH Options
152 .\" ====================================================================
153 .
154 .B \-\-help
155 displays a usage message
156 and
157 .B \%\-\-version
158 shows version information;
159 both exit afterward.
160 .
161 .
162 .TP
163 .BI \-a\~ add-mark
164 Annotate material absent from
165 .I file1
166 but present in
167 .I file2
168 with
169 .I add-mark
170 (default:
171 .RB \[lq] + \[rq]).
172 .
173 .
174 .TP
175 .B \-B
176 Suppress
177 .B br
178 requests normally inserted by
179 .B \-D
180 option.
181 .
182 Use with caution;
183 such requests are the only way to guarantee that deletions and small
184 changes are marked.
185 .
186 .
187 .TP
188 .BI \-c\~ change-mark
189 Annotate material differing between
190 .I file1
191 and
192 .I file2
193 with
194 .I change-mark
195 (default:
196 .RB \[lq] | \[rq]).
197 .
198 .
199 .TP
200 .BI \-d\~ delete-mark
201 Annotate material present in
202 .I file1
203 but absent from
204 .I file2
205 with
206 .I delete-mark
207 (default:
208 .RB \[lq] * \[rq]).
209 .
210 .TP
211 .B \-D
212 Mark changed and deleted material with surrounding delimiters.
213 .
214 .
215 .TP
216 .BI \-M\~ "mark1 mark2"
217 Use
218 .I mark1
219 (default:
220 .RB \[lq] [[ \[rq])
221 and
222 .I mark2
223 (default:
224 .RB \[lq] ]] \[rq])
225 as delimiters when using the
226 .B \-D
227 option.
228 .
229 .
230 .TP
231 .BI \-x\~ diff-command
232 Use the
233 .I diff-command
234 program to perform the comparison of
235 .I file1
236 and
237 .IR file2 .
238 .
239 .I diff-command
240 (default:
241 .BR diff )
242 must accept GNU
243 .MR diff 1 's
244 .B \-D
245 extension option.
246 .
247 .
248 .TP
249 .B \-\-
250 Treat all subsequent arguments as file names,
251 even if they begin with
252 .RB \[lq] \- \[rq].
253 .
254 .
255 .\" ====================================================================
256 .SH "Exit status"
257 .\" ====================================================================
258 .
259 .I gdiffmk
260 exits with
261 .RB status\~ 0
262 if the input files are the same;
263 .B 1
264 if they differ;
265 .B 2
266 upon a usage error;
267 .B 3
268 if the system's
269 .MR diff 1
270 or
271 .MR sh 1
272 commands do not support features
273 .I gdiffmk
274 requires;
275 and
276 .B 4
277 if the
278 .I output
279 argument is a duplicate of
280 .I file1
281 or
282 .IR file2 .
283 .
284 .\" ====================================================================
285 .SH Caveats
286 .\" ====================================================================
287 .
288 The output is not necessarily compatible with all macro packages or
289 preprocessors.
290 .
291 A reliable workaround is to run
292 .I gdiffmk
293 on the output of the final preprocessor instead of the input source.
294 .
295 .
296 .PP
297 .I gdiffmk
298 relies on the
299 .B \-D
300 option of GNU
301 .I diff
302 .\" The hair space `\^` is a kludge--see Savannah #67544.
303 to make a merged \[lq]#ifdef\^\[rq] output format.
304 .
305 Busybox
306 .I diff
307 is known to not support it.
308 .
309 Also see the
310 .BI \-x\~ diff-command
311 option.
312 .
313 .
314 .\" ====================================================================
315 .SH Authors
316 .\" ====================================================================
317 .
318 .I gdiffmk
319 was written by
320 .MT MBianchi@\:Foveal\:.com
321 Mike Bianchi
322 .ME ,
323 now retired.
324 .
325 It is maintained by the
326 .I groff
327 developers.
328 .
329 .
330 .\" ====================================================================
331 .SH "See also"
332 .\" ====================================================================
333 .
334 .MR groff 1 ,
335 .MR \%nroff 1 ,
336 .MR \%troff 1 ,
337 .MR roff 7 ,
338 .MR diff 1
339 .
340 .
341 .\" Restore compatibility mode (for, e.g., Solaris 10/11).
342 .cp \n[*groff_gdiffmk_1_man_C]
343 .do rr *groff_gdiffmk_1_man_C
344 .
345 .
346 .\" Local Variables:
347 .\" fill-column: 72
348 .\" mode: nroff
349 .\" End:
350 .\" vim: set filetype=groff textwidth=72: