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 -p option from GNU patch(1), iykyk.) if you don't specify this, flipdiff is 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 -U option to GNU diff(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 to fnmatch). 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 .gz and .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 of flipdiff. πŸ‘‘

πŸ’€ LIMITATIONS πŸ’€

okay so real talk:

  • this has only been very lightly tested, and it may not even work. using --in-place is 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