quilt(1)

NAME
quilt \- tool to manage series of patches

SYNOPSIS
quilt [-h] command [options]

DESCRIPTION
Quilt is a tool to manage large sets of patches by keeping track of the changes each patch makes. Patches can be applied, un-applied, refreshed, etc. The key philosophical concept is that your primary output is patches. With quilt, all work occurs within a single directory tree. Commands can be be invoked from anywhere within the source tree. They are of the form quilt cmd similar to CVS commands. They can be abbreviated as long as the specified part of the command is unique. All commands print some help text with quilt cmd -h. Quilt manages a stack of patches. Patches are applied incrementally on top of the base tree plus all preceding patches. They can be pushed on top of the stack (quilt push), and popped off the stack (quilt pop). Commands are available for querying the contents of the series file (quilt series, see below), the contents of the stack (quilt applied, quilt previous, quilt top), and the patches that are not applied at a particular moment (quilt next, quilt unapplied). By default, most commands apply to the topmost patch on the stack. Patch files are located in the patches sub-directory of the source tree (see EXAMPLE OF WORKING TREE below). The QUILT_PATCHES environment variable can be used to override this location. The patches directory may contain sub-directories. It may also be a symbolic link instead of a directory. A file called series contains a list of patch file names that defines the order in which patches are applied. Unless there are means by which series files can be generated automatically, it is usually provided along with a set of patches. In this file, each patch file name is on a separate line. Patch files are identified by pathnames that are relative to the patches directory; patches may be in sub-directories below this directory. Lines in the series file that start with a hash character (#) are ignored. You can also add a comment after each patch file name, introduced by a space followed by a hash character. When quilt adds, removes, or renames patches, it automatically updates the series file. Users of quilt can modify series files while some patches are applied, as long as the applied patches remain in their original order.

Different series files can be used to assemble patches in different ways, corresponding for example to different development branches. Before a patch is applied (or ``pushed on the stack''), copies of all files the patch modifies are saved to the .pc/patch directory. The patch is added to the list of currently applied patches (.pc/applied-patches). Later when a patch is regenerated (quilt refresh), the backup copies in .pc/patch are compared with the current versions of the files in the source tree using GNU diff.

Documentation related to a patch can be put at the beginning of a patch file. Quilt is careful to preserve all text that precedes the actual patch when doing a refresh. (This is limited to patches in unified format; see diff documentation). The series file is looked up in the .pc directory, in the root of the source tree, and in the patches directory. The first series file that is found is used. This may also be a symbolic link, or a file with multiple hard links. Usually, only one series file is used for a set of patches, so the patches sub-directory is a convenient location.

The .pc directory and its sub-directories cannot be relocated, but it can be a symbolic link. While patches are applied to the source tree, this directory is essential for many operations, including taking patches off the stack (quilt pop), and refreshing patches (quilt refresh). Files in the .pc directory are automatically removed when they are no longer needed, so there is no need to clean up manually.

QUILT COMMANDS REFERENCE
@REFERENCE@

COMMON OPTIONS TO ALL COMMANDS

    Runs the command in bash trace mode (-x). For internal debugging.

    Use the specified configuration file instead of ~/.quiltrc (or /etc/quilt.quiltrc if ~/.quiltrc does not exist). See the pdf documentation for details about its possible contents. The special value file.

    Print the version number and exit immediately.

EXAMPLE OF WORKING TREE
    work/ -+- ...
           |- patches/ -+- series
           |            |- patch2.diff
           |            |- patch1.diff
           |            +- ...
           +- .pc/ -+- applied-patches
                    |- patch1.diff/ -+- ...
                    |- patch2.diff/ -+- ...
                    +- ...

EXAMPLE
Please refer to the pdf documentation for an example.

CONFIGURATION FILE
Upon startup, quilt evaluates the file .quiltrc in the user's home directory, or the file specified with the --quiltrc option. This file is a regular bash script. Default options can be passed to any command by defining a QUILT_COMMAND_ARGS variable. For example, QUILT_DIFF_ARGS="--color=auto" causes the output of quilt diff to be syntax colored when writing to a terminal. In addition to that, quilt recognizes the following variables:

QUILT_DIFF_OPTS
    Additional options that quilt shall pass to GNU diff when generating patches. A useful setting for C source code is "-p", which causes GNU diff to show in the resulting patch which function a change is in.

QUILT_PATCH_OPTS
    Additional options that quilt shall pass to GNU patch when applying patches. For example, some versions of GNU patch support the "--unified-reject-files" option for generating reject files in unified diff style.

QUILT_DIFFSTAT_OPTS
    Additional options that quilt shall pass to diffstat when generating patch statistics. For example, "-f0" can be used for an alternative output format. Recent versions of diffstat also support alternative rounding methods ("-r1", "-r2").

QUILT_PATCHES
    The location of patch files, defaulting to "patches".

QUILT_SERIES
    The name of the series file, defaulting to "series". Unless an absolute path is used, the search algorithm described above applies.

QUILT_PATCHES_PREFIX
    If set to anything, quilt will prefix patch names it prints with their directory (QUILT_PATCHES).

QUILT_NO_DIFF_INDEX
    By default, quilt prepends an Index: line to the patches it generates. If this variable is set to anything, no line is prepended. This is a shortcut to adding --no-index to both QUILT_DIFF_ARGS and QUILT_REFRESH_ARGS.

QUILT_NO_DIFF_TIMESTAMP
    By default, quilt includes timestamps in headers when generating patches. If this variable is set to anything, no timestamp will be included. This is a shortcut to adding --no-timestamps to both QUILT_DIFF_ARGS and QUILT_REFRESH_ARGS.

EDITOR
    The program to run to edit files. If it isn't redefined in the configuration file, $EDITOR as defined in the environment will be used.

AUTHORS
Quilt started as a series of scripts written by Andrew Morton (patch-scripts). Based on Andrew's ideas, Andreas Gruenbacher completely rewrote the scripts, with the help of several other contributors (see AUTHORS file in the distribution). This man page was written by Martin Quinson, based on information found in the pdf documentation, and in the help messages of each commands.

SEE ALSO
The pdf documentation, which should be under /usr/share/doc/quilt/quilt.pdf. Note that some distributors compress this file. zxpdf(1) can be used to display compressed pdf files. diff(1), patch(1).