Patches

This page covers working with patches in various environments.

Making a patch
This assumes you have your source tree checked out from svn and you've edited it in place to have the feature you want to add.

svn up cd top_of_source_tree svn diff > name_of_patch.patch
 * Update your sources.
 * Resolve any conflicts that might have occurred (see the svn book for help here).
 * Make a patch.
 * Check the patch for errors (for example, don't include a bunch of whitespace changes, unless they're deliberate; make sure you haven't altered any irrelevant files).
 * If necessary, fix your sources and make the patch again.

Applying a patch
This assumes you have a clean source tree. It is simplest to apply patches if you don't have modifications of your own (otherwise you'll have to resolve conflicts as before).

svn up
 * Update your sources.

cd top_of_source_tree patch -p0 < name_of_patch.patch
 * Apply the patch.


 * Test.