Debian Codegraph @

upstream/debian-trixie/man1/gdiffmk.1

raw
1 .TH gdiffmk 1 "3 June 2025" "groff 1.23.0"
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 (C) 2004-2020 Free Software Foundation, Inc.
13 .\"
14 .\" This file is part of gdiffmk, which is part of groff, the GNU roff
15 .\" type-setting system.
16 .\"
17 .\" This program is free software: you can redistribute it and/or modify
18 .\" it under the terms of the GNU General Public License as published by
19 .\" the Free Software Foundation, either version 3 of the License, or
20 .\" (at your option) any later version.
21 .\"
22 .\" This program is distributed in the hope that it will be useful, but
23 .\" WITHOUT ANY WARRANTY; without even the implied warranty of
24 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25 .\" General Public License for more details.
26 .\"
27 .\" You should have received a copy of the GNU General Public License
28 .\" along with this program. If not, see
29 .\" <http://www.gnu.org/licenses/>.
30 .
31 .
32 .\" Save and disable compatibility mode (for, e.g., Solaris 10/11).
33 .do nr *groff_gdiffmk_1_man_C \n[.cp]
34 .cp 0
35 .
36 .\" Define fallback for groff 1.23's MR macro if the system lacks it.
37 .nr do-fallback 0
38 .if !\n(.f .nr do-fallback 1 \" mandoc
39 .if \n(.g .if !d MR .nr do-fallback 1 \" older groff
40 .if !\n(.g .nr do-fallback 1 \" non-groff *roff
41 .if \n[do-fallback] \{\
42 . de MR
43 . ie \\n(.$=1 \
44 . I \%\\$1
45 . el \
46 . IR \%\\$1 (\\$2)\\$3
47 . .
48 .\}
49 .rr do-fallback
50 .
51 .
52 .\" ====================================================================
53 .SH Synopsis
54 .\" ====================================================================
55 .
56 .SY gdiffmk
57 .RB [ \-a\~\c
58 .IR add-mark ]
59 .RB [ \-c\~\c
60 .IR change-mark ]
61 .RB [ \-d\~\c
62 .IR delete-mark ]
63 .RB [ \-x\~\c
64 .IR diff-command ]
65 .RB [ \-D
66 .RB [ \-B ]
67 .RB [ \-M
68 .IR "mark1 mark2" ]]
69 .RB [ \-\- ]
70 .I file1
71 .I file2
72 .RI [ output ]
73 .YS
74 .
75 .
76 .SY gdiffmk
77 .B \-\-help
78 .YS
79 .
80 .
81 .SY gdiffmk
82 .B \-\-version
83 .YS
84 .
85 .
86 .\" ====================================================================
87 .SH Description
88 .\" ====================================================================
89 .
90 .I gdiffmk
91 compares two
92 .MR roff 7
93 documents,
94 .I file1
95 and
96 .IR file2 ,
97 and creates a
98 .I roff
99 document consisting of
100 .I file2
101 with added margin character
102 .RB ( .mc )
103 requests indicating output lines that differ from
104 .I file1.
105 .
106 If the
107 .I file1
108 or
109 .I file2
110 argument is
111 .RB \[lq] \- \[rq],
112 .I gdiffmk
113 reads the standard input stream for that input.
114 .
115 If the
116 .I output
117 operand is present,
118 .I gdiffmk
119 writes output to a file of that name.
120 .
121 If it is
122 .RB \[lq] \- \[rq]
123 or absent,
124 .I gdiffmk
125 writes output to the standard output stream.
126 .
127 .RB \[lq] \- \[rq]
128 cannot be both an input and output operand.
129 .
130 .
131 .\" ====================================================================
132 .SH Options
133 .\" ====================================================================
134 .
135 .B \-\-help
136 displays a usage message
137 and
138 .B \-\-version
139 shows version information;
140 both exit afterward.
141 .
142 .
143 .TP
144 .BI \-a\~ add-mark
145 Use
146 .I add-mark
147 for source lines not in
148 .I file1
149 but present in
150 .IR file2 .
151 .
152 Default:
153 .RB \[lq] + \[rq].
154 .
155 .
156 .TP
157 .B \-B
158 By default,
159 the deleted texts marked by the
160 .B \-D
161 option end with an added
162 .I roff
163 break request,
164 .BR .br ,
165 to ensure that the deletions are marked properly.
166 .
167 This is the only way to guarantee that deletions and small
168 changes get flagged.
169 .
170 This option directs the program not to insert these breaks;
171 it makes no sense to use it without
172 .BR \-D .
173 .
174 .
175 .TP
176 .BI \-c\~ change-mark
177 Use
178 .I change-mark
179 for changed source lines.
180 .
181 Default:
182 .RB \[lq] | \[rq].
183 .
184 .
185 .TP
186 .BI \-d\~ delete-mark
187 Use the
188 .I delete-mark
189 for deleted source lines.
190 .
191 Default:
192 .RB \[lq] * \[rq].
193 .
194 .TP
195 .B \-D
196 Show the deleted portions from changed and deleted text.
197 .
198 .
199 .TP
200 .BI \-M\~ "mark1 mark2"
201 Change the delimiting marks for the
202 .B \-D
203 option.
204 .
205 It makes no sense to use this option without
206 .BR \-D .
207 .
208 Default delimiting marks:
209 .RB \[lq] [[ "\[rq] .\|.\|.\& \[lq]" ]] \[rq].
210 .
211 .
212 .TP
213 .BI \-x\~ diff-command
214 Use the
215 .I diff-command
216 command to perform the comparison of
217 .I file1
218 and
219 .IR file2 .
220 .
221 In particular,
222 .I diff-command
223 should accept the GNU
224 .MR diff 1
225 .B \-D
226 option.
227 .
228 Default:
229 .BR diff .
230 .
231 .
232 .TP
233 .B \-\-
234 Treat all subsequent arguments as file names,
235 even if they begin with
236 .RB \[lq] \- \[rq].
237 .
238 .
239 .\" ====================================================================
240 .SH Bugs
241 .\" ====================================================================
242 .
243 The output is not necessarily compatible with all macro packages
244 and all preprocessors.
245 .
246 A workaround that often overcomes preprocessor problems is to run
247 .I gdiffmk
248 on the output of all the preprocessors instead of the input source.
249 .
250 .
251 .LP
252 .I gdiffmk
253 relies on the
254 .B \-D
255 option of GNU
256 .I diff
257 to make a merged \[lq]#ifdef\[rq] output format.
258 .
259 Busybox
260 .I diff
261 is known to not support it.
262 .
263 Also see the
264 .BI \-x\~ diff-command
265 option.
266 .
267 .
268 .\" ====================================================================
269 .SH Authors
270 .\" ====================================================================
271 .
272 .I gdiffmk
273 was written by
274 .MT MBianchi@\:Foveal\:.com
275 Mike Bianchi
276 .ME ,
277 now retired.
278 .
279 It is maintained by the
280 .I groff
281 developers.
282 .
283 .
284 .\" ====================================================================
285 .SH "See also"
286 .\" ====================================================================
287 .
288 .MR groff 1 ,
289 .MR nroff 1 ,
290 .MR gtroff 1 ,
291 .MR roff 7 ,
292 .MR diff 1
293 .
294 .
295 .\" Restore compatibility mode (for, e.g., Solaris 10/11).
296 .cp \n[*groff_gdiffmk_1_man_C]
297 .do rr *groff_gdiffmk_1_man_C
298 .
299 .
300 .\" Local Variables:
301 .\" fill-column: 72
302 .\" mode: nroff
303 .\" End:
304 .\" vim: set filetype=groff textwidth=72: