diff, patch... (POSIX.1 standard tools)
$ cat numbers.txt $ cat numbers.txt.new [...] [...] 6 6 7 7 8 8 9 9 1 -> 0 1 1 2 2 3 3 4 4 [...] [...]
$ diff numbers.txt numbers.txt.new 11c11 < 1 --- > 0
$ diff -c numbers.txt numbers.txt.new *** numbers.txt 2005-07-01 00:34:56.120398334 +0200 --- numbers.txt.new 2005-07-01 00:34:49.728125967 +0200 *************** *** 8,14 **** 7 8 9 ! 1 1 2 3 --- 8,14 ---- 7 8 9 ! 0 1 2 3
$ diff -u /home/user1/dev/quilt/numbers.txt* --- /home/user1/dev/quilt/numbers.txt 2005-07-01 00:34:56.120398334 +0200 +++ /home/user1/dev/quilt/numbers.txt.new 2005-07-01 00:34:49.728125967 +0200 @@ -8,7 +8,7 @@ 7 8 9 -1 +0 1 2 3Non POSIX.1 standard but most commonly used
usually patch [options] < patchfile
-pnum or --strip num:
strips smallest prefix containing num slashes./home/user1/dev/quilt/numbers.txt
| value | result |
|---|---|
| numbers.txt | |
| -p0 | /home/user1/dev/quilt/numbers.txt |
| -p4 | quilt/numbers.txt |
-d dir: changes to specified directory.Working with a single patch is usually easy!
diff, cvs diff [-u]*, svn diff...patchPatch management is harder
package.tar.gz+ |
|
$ cat patches/patch1.diff Fixes some typos. Jerome Lacoste (jerome@coffeebreaks.org) Index: code/cocktails/five_dominos.txt =================================================================== --- code.orig/cocktails/five_dominos.txt 2005-06-30 23:38:33.061492249 +0200 +++ code/cocktails/five_dominos.txt 2005-06-30 23:39:24.921589010 +0200 @@ -1,4 +1,4 @@ -Boisson de base: rhum blan +Boisson de base: rhum blanc Puissance: 6 Se prepare: au shaker Se sert: dans une coupe
| limitations | |
|---|---|
| multiple copies of source trees + manual editing | error prone, not scalable |
| multiple copies of source trees + custom scripts | portable?, completeness? |
| version control systems | system requirements, overhead, switching between patches still hard... |
quilt {command} [options] [arguments]-p1)
work/ -+- ...
+- patches/-+- series
| |- patch1.diff
| |- patch2.diff
| +- ...
+- .pc/-+- applied-patches
| |- patch1.diff/ -+- ...
| |- patch2.diff/ -+- ...
| +- ...
# comment patch1.diff #patch2.diff patch3.diff # patch comment patch4.diff -p2
new {patchName}add {filePath}refreshfilesdiffremove {filePath}push [-f] [-a]pop [-f] [-a]delete [patchName]seriesapplied/unappliedprevious, top, nextgraphpatches {filePath}
Example of patch dependencies graph
$EDITOR ([vi]): editrenameimport [-f]/foldforkmail.pc and patches): grepsnapshotsetupVarious options
diff --combine {patchName}patches sub-directory content| Demo |
.pc sub-directory.series file.
a PyGTK GUI wrapper for main quilt commands
quilt {command} -h| ? |