Here are some things you should keep in mind if you are going to distribute patches for updating a software package.
Make sure you have specified the file names correctly, either in a context diff header or with an Index: line. If you are patching files in a subdirectory, be sure to tell the patch user to specify a -p or --strip option as needed. Take care to not send out reversed patches, since these make people wonder whether they have already applied the patch.
To save people from partially applying a patch before other patches that should have
gone before it, you can make the first patch in the patch file update a file with a name
like patchlevel.h or version.c, which contains a patch level or version
number. If the input file contains the wrong version number,
An even clearer way to prevent this problem is to put a Prereq: line
before the patch. If the leading text in the patch file contains a line that starts with Prereq:,
To create a patch that changes an older version of a package into a newer version,
first make a copy of the older version in a scratch directory. Typically you do that by
You might be able to reduce the size of the patch by renaming or removing some files
before making the patch. If the older version of the package contains any files that the
newer version does not, or if any files have been renamed between the two versions, make a
If there are any files that you don't need to include in the patch because they can
easily be rebuilt from other files (for example, TAGS and output from
Now you can create the patch. The de-facto standard
Add to the top of the patch a note telling the user any
Email addresses listed on this site may NOT be used for unsolicited commercial email.
Portions (c)Copyright, 1996-2005 by