summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2003-02-20 16:29:37 +0000
committerDaniel Stenberg <daniel@haxx.se>2003-02-20 16:29:37 +0000
commit20fb06ac2b5fe511c167c7eeb282e6cd1568465f (patch)
tree2d99c0c9221288105c280c52edabc2da233b46cb /www
parent3e44579f1e1385f4ea3eec8ac9fe1e6cbdedb20c (diff)
downloadrockbox-20fb06ac2b5fe511c167c7eeb282e6cd1568465f.tar.gz
rockbox-20fb06ac2b5fe511c167c7eeb282e6cd1568465f.zip
How To Work With Patches
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3296 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'www')
-rw-r--r--www/docs/patch.t58
1 files changed, 58 insertions, 0 deletions
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 @@
1#define _PAGE_ How To Work With Patches
2#include "head.t"
3
4<h2>Tools Of The Trade</h2>
5<p>
6Use the tools 'diff' and 'patch'. Preferably the GNU versions. They're readily
7available for all imaginable platforms.
8<p>
9[Add favourite diff/patch links here]
10
11<h2>Creating A Patch</h2>
12<p>
13 We generate diffs (often called patches) using 'diff' in a manner similar to
14this:
15<pre>
16 diff -u oldfile newfile > patch
17</pre>
18<p>
19 People who have checked out code with CVS can do diffs using cvs like this:
20<pre>
21 cvs diff -u file > patch
22</pre>
23<p>
24 'diff' can also be used on a whole directory etc to generate one file with
25changes done to multiple:
26<pre>
27 diff -u olddir newdir > patch
28</pre>
29<p>
30 The -u option means the output is using the 'unified diff' format. Older
31 diff programs don't have that, and then -c (for 'context diff') is OK.
32
33<h2>Applying A Patch</h2>
34<p>
35 Applying a 'patch' (output from diff -u) is done with the 'patch' tool:
36<pre>
37 patch < patchfile
38</pre>
39<p>
40 patch knows that the patchfile is a set of changes on one or more files, and
41will do those to your local files. If your files have changed too much for the
42patch to work, it will save the sections of the patch that aren't possible to
43apply in a file called "filename.rej" (filename being the name of the file for
44which the failing section was intended for). Then you must take care of them
45manually.
46
47<p>
48 If there is path information in the patchfile that you want to cut off
49 from the left, tell patch how many directory levels to cut off to find the
50 names in your file system:
51<pre>
52 patch -p0 < patchfile
53 patch -p1 < patchfile
54 patch -p2 < patchfile
55</pre>
56 ... each example line removes one extra level of dir info from the left.
57
58#include "foot.t"