gdiffmk(1)
π gdiffmk(1) β General Commands Manual π
okay so bestie, welcome to gdiffmk, straight out of the General Commands Manual section (section 1, the "just a normal command, nothing spooky" section π). this whole page is literally gonna teach you how to mark up the diff between groff/nroff/troff files, and it's giving main character energy fr fr β¨
β¨ Name β¨
gdiffmk β mark differences between groff/nroff/troff files π¦
πΈ Synopsis πΈ
gdiffmk [-a add-mark] [-c change-mark] [-d delete-mark] [-x diff-
command] [-D [-B] [-M mark1 mark2]] [--] file1 file2 [output-
file]
gdiffmk --help
gdiffmk --version
so yeah, that's the shape of it π
two files in, optionally an output file, and a whole pile of flags to make it yours π«Ά (the diff-command thing is wrapped across lines up there, don't panic, it's still just -x diff-command).
π¦ Description π¦
okay so here's the whole vibe: gdiffmk compares two roff(7) documents, file1 and file2, and writes another document derived from both of them β either to the standard output stream or to output-file π β and it sprinkles margin character (mc) requests into the output at exactly the spots where the input documents differ β¨
and here's the important bit, bestie, so listen up: gdiffmk does not interpret the source documents π it treats roff comments and nilpotent changes to formatting as meaningful. like, it genuinely does not know that \h'3m', \h'(1 * 3m)', and \h'3m+0' all mean the same thing. no cap, it's just not that kind of girl π
other deets:
- if
file1orfile2is-,gdiffmkreads the standard input stream for that input π - if the
outputoperand is present, it writes output to a file of that name π - if
outputis-or absent, it writes to the standard output stream π -cannot be both an input and an output operand β οΈ like, pick a lane, babe
π OPTIONS π
first up, the two ride-or-die info flags:
--helpβ displays a usage message, then exits π«Ά--versionβ shows version information, then exits β
(both of them dip out right afterward, very "my work here is done" π )
now the actual diff-flavouring ones:
-aadd-mark β annotate material that's absent fromfile1but present infile2with add-mark (default:+) πΈ-Bβ suppressbrrequests that are normally inserted by the-Doption. use with caution π because those requests are literally the only way to guarantee that deletions and small changes get marked β οΈ-cchange-mark β annotate material that differs betweenfile1andfile2with change-mark (default:|) π¦-ddelete-mark β annotate material that's present infile1but absent fromfile2with delete-mark (default:*) π-Dβ mark changed and deleted material with surrounding delimiters π-Mmark1 mark2 β use mark1 (default:[[) and mark2 (default:]]) as the delimiters when you're using the-Doption π-xdiff-command β use the diff-command program to do the comparison offile1andfile2. diff-command (default:diff) must accept GNU diff(1)'s-Dextension option π₯--β treat all the arguments after it as file names, even if they start with-π«Ά (yes, even the chaotic ones)
β Exit status β
gdiffmk exits with these, iykyk:
0β the input files are the same π1β the input files differ π2β usage error π3β your system's diff(1) or sh(1) commands don't support featuresgdiffmkrequires π4β the output argument is a duplicate offile1orfile2π
β οΈ Caveats β οΈ
bestie, the output is not necessarily compatible with all macro packages or preprocessors π a reliable workaround? run gdiffmk on the output of the final preprocessor instead of on the input source β¨ (yes, that's the move, trust)
also: gdiffmk relies on the -D option of GNU diff to make a merged #ifdef output format π§ Busybox diff is known to not support it π also see the -x diff-command option above π
π Authors π
gdiffmk was written by Mike Bianchi, now retired πΈ it is maintained by the groff developers π«Ά
π See also π
groff(1), nroff(1), troff(1), roff(7), diff(1)
and that's the whole page, bestie π this iconic little number is groff 1.24.2, dated 2026-10-01, and it's literally the gdiffmk(1) page β go mark some differences, slay ππ¦β¨
π¦ where this page comes from
- alpine 3.24: groff-doc 1.24.2-r0 Β· GPL-3.0-or-later
- Copyright 2004-2016 Free Software Foundation, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms