FLIPDIFF(1)
π FLIPDIFF π
okay bestie, so flipdiff is literally here to exchange the order of two incremental patches β that's it, that's the whole job. it lives in section 1 of the man pages and it's giving "tiny tool, big brain energy" π§ β¨
β¨ SYNOPSIS β¨
flipdiff [[-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] [--in-place] diff1 diff2
flipdiff {[--help] | [--version]}
πΈ DESCRIPTION πΈ
so like, flipdiff swaps the order of two patch files that apply one after the other. cutie behavior, right? π¦
β οΈ but bestie, listen: the patches must be "clean" β the context lines have to match and there should be no mis-matched offsets. no cap. if they're messy it's not gonna work out.
the swapped patches get sent to standard output, with a little marker line between them:
=== 8< === cut here === 8< ===
...unless you pass the --in-place option. in that case the output goes back into the original input files. iconic but also scary, we'll get to that π
π OPTIONS π
-pn,--strip-match=nβ when it's comparing filenames, just ignore the first n pathname components from both patches. (this is giving-poption from GNUpatch(1), iykyk.) if you don't specify this,flipdiffis smart enough to auto-determine the optimal number of path components to strip β it finds the smallest value where at least one file matches between the two patches. main character problem-solving energy fr fr β¨-q,--quietβ quieter output, bestie. don't emit rationale lines at the beginning of each patch. shhh π€«-Un,--unified=nβ try to display n lines of context (this needs at least n lines of context in both input files, so no overpromising). (similar to the-Uoption to GNUdiff(1).) π-dpattern,--drop-context=PATTERNβ don't display any context on files that match the shell wildcard pattern. you can give this option multiple times, go off π
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 tofnmatch). this is so that*/basename-type patterns can be given without limiting the number of pathname components. so thoughtful π₯Ή
-i,--ignore-caseβ consider upper- and lower-case to be the same. aAaAaA we don't care π¦-w,--ignore-all-spaceβ ignore whitespace changes in patches. also makes patch application ignore whitespace when reconstructing files. double duty, obsessed π-b,--ignore-space-changeβ ignore changes in the amount of whitespace. same vibe, different flavor β¨-B,--ignore-blank-linesβ ignore changes whose lines are all blank. nothing to see here π«Ά--color=WHENβ colorize the output; WHEN can be'never','always', or'auto'(default:auto, use'never'to disable). pretty output my beloved ππ-z,--decompressβ decompress files with extensions.gzand.bz2. unzip the vibes π¦β¨--in-placeβ write output to the original input files. (see the limitations below, bestie, please read them, i'm begging π)--helpβ display a short usage message. π--versionβ display the version number offlipdiff. π
π LIMITATIONS π
okay so real talk:
- this has only been very lightly tested, and it may not even work. using
--in-placeis not recommended at the moment. like, genuinely. don't. π - there are some cases where it is not possible to meaningfully flip patches without understanding the semantics of the content. this program only uses complete lines that appear at some stage during the application of the two patches, and it never composes a line from parts. no Frankenstein lines here, periodt π§βοΈβ
- because of that, it's generally a good idea to read through the output to check that it makes sense. yes, actually read it. all of it. i know π
π«Ά AUTHOR π«Ά
Tim Waugh <twaugh@redhat.com> Package maintainer
patchutils πΈ 23 January 2009 π
and that's the whole page bestie β sending you all the flip energy, go slay those patches π β¨π¦ no cap, read the limitations again tho π
π¦ where this page comes from
- alpine 3.23: patchutils-doc 0.4.4-r0 Β· GPL-2.0-or-later
- alpine 3.24: patchutils-doc 0.4.5-r0 Β· GPL-2.0-or-later
- arch rolling: patchutils 0.4.5-1 Β· GPL-2.0-only
- fedora 44: patchutils 0.4.4-3.fc44 Β· GPL-2.0-or-later
- ubuntu stonking: patchutils 0.4.5-1ubuntu1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms