INTERDIFF(1)

🌸 INTERDIFF(1) β€” the interdiff manual, but make it make sense 🌸

okay bestie, pull up a chair because we're about to talk about interdiff, section 1 of the manual pages, and honestly? she's an icon and she deserves your attention. πŸ’…


✨ NAME ✨

interdiff β€” show differences between two diff files. that's it, that's the whole job, and she does it flawlessly. no cap.


πŸ¦‹ SYNOPSIS πŸ¦‹

lowkey this is the part everyone scrolls past, but like... don't, because it's the whole vibe:

interdiff [[-p n] | [--strip-match=n]] [[-U n] | [--unified=n]]
          [[-d PAT] | [--drop-context=PAT]] [[-q] | [--quiet]] [[-z] |
          [--decompress]] [[-b] | [--ignore-space-change]] [[-B] |
          [--ignore-blank-lines]] [[-i] | [--ignore-case]] [[-w] |
          [--ignore-all-space]] [--color=WHEN] [[--interpolate] |
          [--combine] | [--flip]] [--no-revert-omitted] diff1 diff2

and also, for when you just wanna know things:

interdiff {[--help] | [--version]}

πŸ’– DESCRIPTION πŸ’–

so here's the tea: interdiff creates a unified format diff that expresses the difference between two diffs. yes, a diff of diffs. she's meta like that. 🧚

⚠️ the diffs must both be relative to the same files. for best results, the diffs must have at least three lines of context.

want to reverse a patch? use /dev/null for diff2. slay, so simple.

want to reduce the amount of context in a patch? literally just:

interdiff -U1 /dev/null patchfile

here's the thing though, and this is important: since interdiff doesn't have the advantage of being able to look at the files that are to be modified, it has stricter requirements on the input format than patch(1) does. 😭

the output of GNU diff will be okay β€” even with extensions β€” but if you intend to use a hand-edited patch, it might be wise to clean up the offsets and counts using recountdiff(1) first. do your future self a favour, bestie. 🫢

also note, however, that the two patches must both be relative to the versions of the same original set of files.

the diffs may be in context format. the output, however, will be in unified format. periodt. ✨


πŸ‘‘ OPTIONS πŸ‘‘

okay this is the part you actually came for. every single one, no skips, let's go:

  • -h β€” ignored, for compatibility with older versions of interdiff. this option will go away soon. she's on her way out the door, we don't stan her, we just tolerate her. πŸ’€
  • -pn, --strip-match=n β€” when comparing filenames, ignore the first n pathname components from both patches. (this is similar to the -p option to GNU patch(1).) if this option is not specified, interdiff will automatically determine the optimal number of path components to strip by finding the smallest value where at least one file matches between the two patches. she figures it out herself, main character energy. πŸ’…
  • -q, --quiet β€” quieter output. don't emit rationale lines at the beginning of each patch. shhhh. 🀫
  • -Un, --unified=n β€” attempt to display n lines of context (requires at least n lines of context in both input files). (this is similar to the -U option to GNU diff(1).)
  • -dPATTERN, --drop-context=PATTERN β€” don't display any context on files that match the shell wildcard PATTERN. this option can be given multiple times. πŸ” note that the interpretation of the shell wildcard pattern does not count slash characters or periods as special (in other words, no flags are given to fnmatch). this is so that "*/basename"-type patterns can be given without limiting the number of pathname components.
  • -i, --ignore-case β€” consider upper- and lower-case to be the same. A = a, we're all equals here. πŸ’œ
  • -w, --ignore-all-space β€” ignore whitespace changes in patches. also makes patch application ignore whitespace when reconstructing files.
  • -b, --ignore-space-change β€” ignore changes in the amount of whitespace.
  • -B, --ignore-blank-lines β€” ignore changes whose lines are all blank.
  • --color=WHEN β€” colorize the output; WHEN can be 'never', 'always', or 'auto' (default: auto, use 'never' to disable). cute colours ✨ (the WHEN is case-insensitive, by the way. ok wait, no, i'm just playing β€” that detail is not in here. moving on.)
  • -z, --decompress β€” decompress files with extensions .gz and .bz2. πŸ—œοΈ
  • --interpolate β€” run as "interdiff". this is the default.
  • --combine β€” run as "combinediff". see combinediff(1) for more information about how the behaviour is altered in this mode.
  • --no-revert-omitted β€” (for interpolation mode only) when a file is changed by the first patch but not by the second, don't revert that change.
  • --help β€” display a short usage message.
  • --version β€” display the version number of interdiff.

🌈 EXAMPLES 🌈

basic usage, the everyday slay:

interdiff -z 3.2pre1.patch.gz 3.2pre2.patch.gz

reversing a patch:

interdiff patch /dev/null

reversing part of a patch (and ignoring the rest) β€” look at that line continuation, she's serving:

filterdiff -i file.c patchfile | \
  interdiff /dev/stdin /dev/null

πŸ’€ BUGS πŸ’€

there are currently no known bugs in interdiff; but there are some caveats. πŸ‘€

if you find a bug, please report it (along with a minimal test case) to Tim Waugh <twaugh@redhat.com>. he wants to know. fr fr.

there are some sets of patches in which there is just not enough information to produce a proper interdiff. in this case, the strategy employed is to revert the original patch and apply the new patch. this, unfortunately, means that interdiffs are not guaranteed to be reversible. 😭 not me finding out the hard way.


πŸŽ€ SEE ALSO πŸŽ€


🫢 AUTHORS 🫢

  • Tim Waugh <twaugh@redhat.com>
    • Package maintainer
  • Michael K. Johnson <johnsonm@redhat.com>
    • Original man page contributor

and that's the whole page, bestie!! this one's from patchutils, dated 23 June 2009, and honestly she's aged like fine wine. πŸ“ go forth and diff your diffs. mwah. πŸ’–βœ¨

πŸ“¦ where this page comes from