table of contents
| GENDIFF(1) | General Commands Manual | GENDIFF(1) |
NAME¶
gendiff - Utility to aid in error-free diff file generation
SYNOPSIS¶
gendiff DIRECTORY DIFF-EXTENSION
DESCRIPTION¶
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.
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. This allows for generating diffs from source code without making a full copy of the directory, which you'd otherwise need when using the diff(1) utility directly.
gendiff is commonly used to creating patches for the purposes of packaging software with rpmbuild(1).
ARGUMENTS¶
DIRECTORY
DIFF-EXTENSION
EXIT STATUS¶
On success, 0 is returned, a non-zero failure code otherwise.
EXAMPLES¶
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).
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
SEE ALSO¶
| 2025-11-07 | RPM 6.0.0 |