GENDIFF(1)

2025-09-12

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

The directory to generate a diff from.

DIFF-EXTENSION

The diff extension to look for.

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

diff(1), patch(1)

RPM 6.0.90

Index

2025-09-12