From 20fb06ac2b5fe511c167c7eeb282e6cd1568465f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 20 Feb 2003 16:29:37 +0000 Subject: How To Work With Patches git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3296 a1c6a512-1295-4272-9138-f99709370657 --- www/docs/patch.t | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 www/docs/patch.t (limited to 'www/docs') diff --git a/www/docs/patch.t b/www/docs/patch.t new file mode 100644 index 0000000000..8c601b0b14 --- /dev/null +++ b/www/docs/patch.t @@ -0,0 +1,58 @@ +#define _PAGE_ How To Work With Patches +#include "head.t" + +

Tools Of The Trade

+

+Use the tools 'diff' and 'patch'. Preferably the GNU versions. They're readily +available for all imaginable platforms. +

+[Add favourite diff/patch links here] + +

Creating A Patch

+

+ We generate diffs (often called patches) using 'diff' in a manner similar to +this: +

+  diff -u oldfile newfile > patch
+
+

+ People who have checked out code with CVS can do diffs using cvs like this: +

+  cvs diff -u file > patch
+
+

+ 'diff' can also be used on a whole directory etc to generate one file with +changes done to multiple: +

+  diff -u olddir newdir > patch 
+
+

+ The -u option means the output is using the 'unified diff' format. Older + diff programs don't have that, and then -c (for 'context diff') is OK. + +

Applying A Patch

+

+ Applying a 'patch' (output from diff -u) is done with the 'patch' tool: +

+  patch < patchfile
+
+

+ patch knows that the patchfile is a set of changes on one or more files, and +will do those to your local files. If your files have changed too much for the +patch to work, it will save the sections of the patch that aren't possible to +apply in a file called "filename.rej" (filename being the name of the file for +which the failing section was intended for). Then you must take care of them +manually. + +

+ If there is path information in the patchfile that you want to cut off + from the left, tell patch how many directory levels to cut off to find the + names in your file system: +

+  patch -p0 < patchfile
+  patch -p1 < patchfile
+  patch -p2 < patchfile
+
+ ... each example line removes one extra level of dir info from the left. + +#include "foot.t" -- cgit v1.2.3