quilt cheat sheet / quick reference

‹ LXC command cheat sheet / quick reference | Building debian .deb packages from source ›

quilt is a command line tool that allows you to push and pop a given list of patch files onto a source tree, as if there were a stack of patches.

The list of patches is represented by a directory containing individual patch files. The directory also contains a file called series with one patch filename per line (first to be applied at the top of the file).

The state of the patch stack is maintained in a directory called .pc/

Configure patch directory

export QUILT_PATCHES=debian/patches

Add new patch

  • quilt new 007_mypatch.patch -- create new empty patch
  • quilt import existingfile.patch -- create new managed patch from existing external file

Modify existing patch

By editing the file directly:

# do this first step before the file exists, if it is a new file
quilt add path/to/file.c
# Edit path/to/file.c
quilt refresh

By applying a patch from stdin:

cat patchfile | quilt fold
quilt refresh

By running the text editor defined in $EDITOR env variable:

# do this first step before the file exists, if it is a new file
quilt edit path/to/filename
quilt refresh

Query patch list

  • quilt series - list out all patches (applied and unapplied)
  • quilt applied -- list out only the applied patches
  • quilt unapplied -- list out only the unapplied patches
  • quilt top -- peek at most recently applied patch
  • quilt previous -- peek at the second-most-recently applied patch
  • quilt next -- peek at first pending unapplied patch

Query patch content

  • quilt files -- print list of files that topmost patch changes
  • quilt diff -- show the content of the most recently applied patch

Apply and unapply patches

  • quilt push -- apply the "next" patch
  • quilt pop -- unapply the "top" patch

Delete patch

  • quilt delete -r -- pop, then delete the "top" patch
  • quilt delete -n -r -- delete the "next" patch

Rename patch

  • quilt rename new_name -- rename top patch
Subscribe to All Posts - Wesley Tanaka