GENDIFF(1)

πŸ¦‹ GENDIFF(1) β€” the girlies' guide to error-free diff file generation πŸ’…

okay so bestie, welcome to gendiff(1) from the General Commands Manual section. this is the tool that makes diff files without you losing your entire mind, no cap ✨


✨ NAME ✨

gendiff β€” Utility to aid in error-free diff file generation πŸŽ€


🌸 SYNOPSIS 🌸

gendiff DIRECTORY DIFF-EXTENSION

that's it. two little arguments. two. i promise you can do this 🫢


πŸ’– DESCRIPTION πŸ’–

so gendiff is a tool for generating a diff file from a single directory. the generated diff can be applied with the patch(1) program to recreate the changes. iconic behaviour honestly πŸ”₯

here's the tea: gendiff looks for any files with DIFF-EXTENSION as their extension in the specified DIRECTORY, and runs diff(1) on the files with DIFF-EXTENSION and the counterpart without it, in that order. order matters bestie, don't come for me πŸ™ˆ

the way that this is SO much better than raw diff(1): it lets you generate diffs from source code without making a full copy of the directory, which you'd otherwise need when using the diff(1) utility directly. no duplicating gigabytes of files. we love a resource-conscious queen πŸ‘‘

and for the packaging girlies: gendiff is commonly used to creating patches for the purposes of packaging software with rpmbuild(1). if you build RPMs, this is your moment. main character energy fr fr ⭐


🧚 ARGUMENTS 🧚

  • DIRECTORY β€” the directory to generate a diff from. that's the whole vibe check.
  • DIFF-EXTENSION β€” the diff extension to look for. yes, extension. yes, it matters.

🌈 EXIT STATUS 🌈

on success, 0 is returned. a nonzero failure code otherwise. classic. no notes πŸ’€


πŸ“ EXAMPLES πŸ“

okay let's walk through this together, bestie. picture it:

assuming you need to modify a source file called somefile.cpp and have chosen the extension fix, copy it to somefile.cpp.fix before editing it. then edit the original file (somefile.cpp).

⚠️ the copy happens FIRST, the editing happens SECOND. do not switch those. that's literally the whole point of error-free generation, bestie 😭

after editing all the files you need to edit in this fashion, enter the directory one level above where the source code resides, and run gendiff on it:

gendiff myproject-1.0 .fix > myproject-1.0-fix.patch

look at that redirect doing its thing. slay πŸ’…βœ¨


πŸ‘‘ SEE ALSO πŸ‘‘

diff(1), patch(1)


and that's the whole page bestie!! this served RPM 6.1.0 energy and was dated 2026-08-20, so you know it's fresh 🫢✨ go forth and generate diffs, you absolute icon πŸ’œ

πŸ“¦ where this page comes from