Creative Commons License
This work is licensed under a Creative Commons Attribution 2.5 License.

quilt: An Introduction

Jerome Lacoste

CoffeeBreaks

Agenda

Text file diffs

Example 1: 'normal' diff

$ 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  

Example 2: copied context diff

$ 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 

Example 3: unified context diff

$ 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
 3  
Non POSIX.1 standard but most commonly used

Using Patch

usually patch [options] < patchfile

Typical patch life cycle

Working with a single patch is usually easy!

Patch management is harder

Patch Storage Strategies

package.tar.gz+
  • single package.diff
  • set of multiple patches [with embedded descriptions]
$ 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

Patch Management Stragegies

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...

Agenda

Quilt

Quilt: concepts and features

Quilt: structure

Quilt main commands

Developing a patch

  1. create a new patch: new {patchName}
  2. add file(s) to a patch: add {filePath}
  3. manual edit
  4. update patch: refresh
  5. list files in patch: files
  6. show patch: diff
  7. remove file(s) from a patch: remove {filePath}

Managing patches: basics

Quilt graph output

Example of patch dependencies graph

Managing patches: advanced

Helper/Shortcuts

Quilt: Distributing patches

Various options

Quilt

Demo

Agenda

Pitfalls, tips and limitations

Related tool: gquilt

a PyGTK GUI wrapper for main quilt commands

Summary

Links

More information Related tools

Questions

?