quilt(1)

๐Ÿฆ‹ NAME ๐Ÿฆ‹

quilt โ€” manage a series of patches


๐Ÿ’… SYNOPSIS ๐Ÿ’…

quilt [--quiltrc file] [--trace] command [options]

quilt [command] -h
quilt --version

โœจ DESCRIPTION โœจ

Okay bestie, listen. quilt</p> is a tool for managing big sets of patches, and the way it does that is by keeping track of the changes each patch makes. You can apply patches, unapply them, refresh them, and so on and so forth. ๐ŸŽ€ The whole philosophical vibe here โ€” the key concept, if you will โ€” is that your primary working material is patches. Not the code. The patches. Periodt.

With quilt, all work happens inside a single directory tree. You can invoke commands from literally anywhere inside that source tree. And just like CVS, Subversion, or Git, quilt takes commands in the form quilt command. ๐Ÿ’– A command can be truncated (abbreviated!) as long as the part you typed is unambiguous. If it's ambiguously short, quilt will list out every command matching that prefix and then exit. Rude but fair. Also, every command will print a brief contextual help message and exit if you hand it the -h option.

Quilt manages a stack of patches. Patches get applied incrementally, on top of the base tree plus all the preceding patches. You can push them onto the stack (quilt push) and pop them off the stack (quilt pop). ๐Ÿซถ There are commands for querying what's in the stack (quilt applied, quilt previous, quilt top) and commands for the patches that aren't applied at any given moment (quilt next, quilt unapplied). By default, most commands apply to the topmost patch on the stack. Main character patch energy, honestly.

Patch files live in the patches subdirectory of the source tree (peep the Example of working tree over under FILES below ๐Ÿ‘€). The QUILT_PATCHES environment variable overrides this default location. When it's not found in the current directory, that subdirectory gets searched recursively up through the parent directories โ€” which is lowkey the same way Git searches for its configuration files, iykyk. The patches directory may contain subdirectories. It may also be a symbolic link instead of an actual directory. Slay.

Quilt creates and maintains a file called series, and that file defines the order in which patches are applied. ๐Ÿ”ฅ The QUILT_SERIES environment variable overrides this default name. You can query the contents of the series file at any time with quilt series. In this file, each patch file name sits on its own separate line. Patch files are identified by path names that are relative to the patches directory; so yes, patches may be in subdirectories below that directory. Lines in the series file that start with a hash character (#) are ignored. ๐Ÿ’€

Patch options โ€” like the strip level, or whether the patch is reversed โ€” can be added after each patch file name. Options are introduced by a space, separated by spaces, and they follow the syntax of the patch(1) options (e.g., -p2). Quilt records patch options automatically whenever a command that supports them gets used. Without options, strip level 1 is assumed. You can also add a comment after each patch file name and options, 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. Unless there are means by which a series file can be generated automatically, you should provide it along with any set of quilt-managed patches you distribute. Different series files can be used to assemble patches in different ways, corresponding (for example) to different development branches. โœจ

Before a patch is applied, copies of all the files the patch modifies are saved to the .pc/patch-name directory, where patch-name is the name of the patch (for example, fix-buffer-overflow.patch). The patch is then 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-name are compared with the current versions of the files in the source tree using GNU diff(1). ๐ŸŽ€

A similar process occurs when you start a new patch (quilt new); the new patch file name gets added to the series file. A file to be changed by the patch is backed up and opened for editing (quilt edit). After editing, inspect the impact of your changes (quilt diff); the changes stay local to your working tree until you call quilt refresh to write them out to the patch file. ๐Ÿ’œ

Documentation related to a patch can be put at the beginning of its patch file (quilt header). 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 the GNU Diffutils manual.)

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 the one that gets 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, which makes the patches subdirectory a convenient location. ๐Ÿ’…

๐Ÿšจ The .pc directory cannot be relocated โ€” but it can be a symbolic link. Its subdirectories must not be renamed or restructured. While patches are applied to the source tree, this directory is essential for many operations, including popping patches off the stack and refreshing them. 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 ๐ŸŒธ

add [-P patch] {file} ...

Add one or more files to the topmost or named patch. Files must be added to the patch before being modified. Files that are modified by patches already applied on top of the specified patch cannot be added. ๐Ÿ˜ญ

  • -P patch โ€” Patch to add files to.

annotate [-P patch] {file}

Print an annotated listing of the specified file, showing which patches modify which lines. Only applied patches are included.

  • -P patch โ€” Stop checking for changes at the specified rather than the topmost patch.

applied [patch]

Print a list of applied patches, or all patches up to and including the specified patch in the file series.

delete [-r] [--backup] [patch|-n]

Remove the specified or topmost patch from the series file. If the patch is applied, quilt will attempt to remove it first. (Only the topmost patch can be removed right now.) ๐Ÿ‘‘

  • -n โ€” Delete the next patch after topmost, rather than the specified or topmost patch.
  • -r โ€” Remove the deleted patch file from the patches directory as well.
  • --backup โ€” Rename the patch file to patch~ rather than deleting it. Ignored if not used with -r.

diff [-p n|-p ab] [-u|-U num|-c|-C num] [--combine patch|-z] [-R] [-P patch] [--snapshot] [--diff=utility] [--no-timestamps] [--no-index] [--sort] [--color[=always|auto|never]] [file ...]

Produces a diff of the specified file(s) in the topmost or specified patch. If no files are specified, all files that are modified are included. โœจ

  • -p n โ€” Create a -p n style patch (-p0 or -p1 are supported).
  • -p ab โ€” Create a -p1 style patch, but use a/file and b/file as the original and new filenames instead of the default dir.orig/file and dir/file names.
  • -u, -U num, -c, -C num โ€” Create a unified diff (-u, -U) with num lines of context. Create a context diff (-c, -C) with num lines of context. The number of context lines defaults to 3.
  • --no-timestamps โ€” Do not include file timestamps in patch headers.
  • --no-index โ€” Do not output Index: lines.
  • -z โ€” Write to standard output the changes that have been made relative to the topmost or specified patch.
  • -R โ€” Create a reverse diff.
  • -P patch โ€” Create a diff for the specified patch. (Defaults to the topmost patch.)
  • --combine patch โ€” Create a combined diff for all patches between this patch and the patch specified with -P. A patch name of - is equivalent to specifying the first applied patch.
  • --snapshot โ€” Diff against snapshot (see quilt snapshot -h).
  • --diff= utility โ€” Use the specified utility for generating the diff. The utility is invoked with the original and new file name as arguments.
  • --color[=always|auto|never] โ€” Use syntax coloring (auto activates it only if the output is a tty).
  • --sort โ€” Sort files by their name instead of preserving the original order.

edit file ...

Edit the specified file(s) in $EDITOR after adding it (them) to the topmost patch. ๐Ÿ–Š๏ธ

files [-v] [-a] [-l] [--combine patch] [patch]

Print the list of files that the topmost or specified patch changes.

  • -a โ€” List all files in all applied patches.
  • -l โ€” Add patch name to output.
  • -v โ€” Verbose, more user friendly output.
  • --combine patch โ€” Create a listing for all patches between this patch and the topmost or specified patch. A patch name of - is equivalent to specifying the first applied patch.

fold [-R] [-q] [-f] [-p strip-level]

Integrate the patch read from standard input into the topmost patch: after making sure that all files modified are part of the topmost patch, the patch is applied with the specified strip level (which defaults to 1).

  • -R โ€” Apply patch in reverse.
  • -q โ€” Quiet operation.
  • -f โ€” Force apply, even if the patch has rejects. Unless in quiet mode, apply the patch interactively: the patch utility may ask questions.
  • -p strip-level โ€” The number of pathname components to strip from file names when applying patchfile.

fork [new_name]

Fork the topmost patch. Forking a patch means creating a verbatim copy of it under a new name, and using that new name instead of the original one in the current series. This is useful when a patch has to be modified, but the original version of it should be preserved โ€” e.g. because it is used in another series, or for the history. ๐Ÿ“œ A typical sequence of commands would be: fork, edit, refresh.

If new_name is missing, the name of the forked patch will be the current patch name, followed by -2. If the patch name already ends in a dash-and-number, the number is further incremented (e.g., patch.diff, patch-2.diff, patch-3.diff). ๐Ÿ”ข

graph [--all] [--reduce] [--lines[=num]] [--edge-labels=files] [-T ps] [patch]

okay so graph is the one that draws you a whole dot(1) directed graph showing the dependencies between applied patches. A patch depends on another patch when both of them touch the same file โ€” or, if you passed --lines, when their modifications overlap. Unless you say otherwise, the graph includes all the patches that the topmost patch depends on. And if you name a patch? Then instead of the topmost one, it builds the graph for that patch, and the graph will include every other patch that this patch depends on plus every patch that depends on this patch. it's giving ancestry.com for your patch stack fr fr ๐ŸŒณ๐Ÿ’…

  • --all โ€” builds a graph including all applied patches and their dependencies. (Unapplied patches are not included, bestie, don't @ me.)
  • --reduce โ€” eliminates the transitive edges from the graph.
  • --lines[=num] โ€” computes dependencies by looking at the lines the patches modify. Unless you pass a different num, two lines of context are included.
  • --edge-labels=files โ€” labels the graph edges with the file names that the adjacent patches modify.
  • -T ps โ€” directly produces a PostScript output file.

grep ๐ŸŒธ

grep [-h|options] {pattern}

Greps through the source files, recursively, and it skips patches and quilt meta-information while it's at it. No filename argument? Then the whole source tree gets searched. For the actual options, go look at the grep(1) manual page, bestie.

  • -h โ€” prints this help. The grep -h option can be passed after a double-dash (--). And search expressions that start with a dash can be passed after a second double-dash (-- --). ikyk โœจ

header [-a|-r|-e] [--backup] [--strip-diffstat] [--strip-trailing-whitespace] [patch]

Prints or changes the header of the topmost patch, or of whichever patch you name.

  • -a, -r, -e โ€” append to (-a) or replace (-r) the existing patch header, or edit (-e) the header in $EDITOR. If none of these options is given, it just prints the patch header.
  • --strip-diffstat โ€” strips diffstat output from the header.
  • --strip-trailing-whitespace โ€” strips trailing whitespace at the end of lines of the header.
  • --backup โ€” creates a backup copy of the old version of a patch as patch~.

import ๐Ÿ“ฅ

import [-p num] [-R] [-P patch] [-f] [-d {o|a|n}] patchfile ...

Imports external patches. Heads up: the patches get inserted following the current top patch, and you must push them after import to actually apply them.

  • -p num โ€” number of directory levels to strip when applying (default=1).
  • -R โ€” apply patch in reverse.
  • -P patch โ€” patch filename to use inside quilt. This option can only be used when importing a single patch.
  • -f โ€” overwrite/update existing patches.
  • -d {o|a|n} โ€” when overwriting in an existing patch, keep the old (o), all (a), or new (n) patch header. If both patches include headers, this option must be specified. It's only effective when -f is used.

mail ๐Ÿ’Œ

mail {--mbox file|--send} [-m text] [-M file] [--prefix prefix] [--sender ...] [--from ...] [--to ...] [--cc ...] [--bcc ...] [--subject ...] [--reply-to message] [--charset ...] [--signature file] [first_patch [last_patch]]

Creates mail messages from a specified range of patches, or from all the patches in the series file, and then either stores them in a mailbox file or sends them immediately. The editor opens with a template for the introduction. Please see /usr/share/doc/quilt/README.MAIL for details. When you're specifying a range of patches, a first patch name of - denotes the first, and a last patch name of - denotes the last patch in the series. so convenient, we love that for us ๐Ÿซถ

  • -m text โ€” text to use as the text in the introduction. When this option is used, the editor will not be invoked, and the patches will be processed immediately.
  • -M file โ€” like the -m option, but reads the introduction from file.
  • --prefix prefix โ€” use an alternate prefix in the bracketed part of the subjects generated. Defaults to patch.
  • --mbox file โ€” store all messages in the specified file in mbox format. The mbox can later be sent using formail, for example.
  • --send โ€” send the messages directly.
  • --sender โ€” the envelope sender address to use. The address must be of the form user@domain.name. No display name is allowed.
  • --from, --subject โ€” the values for the From and Subject headers to use. If no --from option is given, the value of the --sender option is used.
  • --to, --cc, --bcc โ€” append a recipient to the To, Cc, or Bcc header.
  • --charset โ€” specify a particular message encoding on systems which don't use UTF-8 or ISO-8859-15. This character encoding must match the one used in the patches.
  • --signature file โ€” append the specified signature to messages (defaults to ~/.signature if found; use - for no signature).
  • --reply-to message โ€” add the appropriate headers to reply to the specified message.

new ๐Ÿฆ‹

new [-p n] {patchname}

Creates a new patch with the specified file name and inserts it after the topmost patch. The name can be prefixed with a sub-directory name, which lets you group related patches together. cute AND organized, main character energy ๐Ÿ‘‘

  • -p n โ€” create a -p n style patch (-p0 or -p1 are supported).

Quilt can be used in sub-directories of a source tree. It determines the root of a source tree by searching for a directory above the current working directory. Create a directory in the intended root directory if quilt chooses a top-level directory that is too high up in the directory tree.


next โญ๏ธ

next [patch]

Prints the name of the next patch after the specified or topmost patch in the series file.


patches ๐Ÿงš

patches [-v] [--color[=always|auto|never]] {file} [files...]

Prints the list of patches that modify any of the specified files. (It uses a heuristic to determine which files are modified by unapplied patches. Note that this heuristic is much slower than scanning applied patches, so don't be shocked by the wait.)

  • -v โ€” verbose, more user friendly output.
  • --color[=always|auto|never] โ€” use syntax coloring (auto activates it only if the output is a tty).

pop ๐Ÿ“ค

pop [-afRqv] [--refresh] [num|patch]

Removes patch(es) from the stack of applied patches. Without options, the topmost patch is removed. When a number is specified, it removes that many patches. When a patch name is specified, it removes patches until the specified patch ends up on top of the stack. Patch names may include the patches/ prefix, which means filename completion can be used. ๐Ÿ’…

  • -a โ€” remove all applied patches.
  • -f โ€” force remove. The state before the patch(es) were applied will be restored from backup files.
  • -R โ€” always verify if the patch removes cleanly; don't rely on timestamp checks.
  • -q โ€” quiet operation.
  • -v โ€” verbose operation.
  • --refresh โ€” automatically refresh every patch before it gets unapplied.

previous โฎ๏ธ

previous [patch]

Prints the name of the previous patch before the specified or topmost patch in the series file.


push ๐Ÿš€

push [-afqvm] [--fuzz=N] [--merge[=merge|diff3]] [--leave-rejects] [--color[=always|auto|never]] [--refresh] [num|patch]

Applies patch(es) from the series file. Without options, the next patch in the series file is applied. When a number is specified, it applies that many patches. When a patch name is specified, it applies all patches up to and including the specified patch. Patch names may include the patches/ prefix, which means filename completion can be used. go off, stack ๐ŸŒˆ

  • -a โ€” apply all patches in the series file.
  • -q โ€” quiet operation.
  • -f โ€” force apply, even if the patch has rejects.
  • -v โ€” verbose operation.
  • --fuzz=N โ€” set the maximum fuzz factor (default: 2).
  • -m, --merge[=merge|diff3] โ€” merge the patch file into the original files (see patch(1)).
  • --leave-rejects โ€” leave around the reject files patch produced, even if the patch is not actually applied.
  • --color[=always|auto|never] โ€” use syntax coloring (auto activates it only if the output is a tty).
  • --refresh โ€” automatically refresh every patch after it was successfully applied.

refresh โœจ

refresh [-p n|-p ab] [-u|-U num|-c|-C num] [-z[new_name]] [-f] [--no-timestamps] [--no-index] [--diffstat] [--sort] [--backup] [--strip-trailing-whitespace] [patch]

Refreshes the specified patch, or the topmost patch by default. Documentation that comes before the actual patch in the patch file is retained. ๐Ÿซถ

It is possible to refresh patches that are not on top. If any patches on top of the patch to refresh modify the same files, the script aborts by default. Patches can still be refreshed with -f. In that case this script will print a warning for each shadowed file, changes by more recent patches will be ignored, and only changes in files that have not been modified by any more recent patches will end up in the specified patch.

  • -p n โ€” create a -p n style patch (-p0 or -p1 supported).
  • -p ab โ€” create a -p1 style patch, but use a/file and b/file as the original and new filenames instead of the default dir.orig/file and dir/file names.
  • -u, -U num, -c, -C num โ€” create a unified diff (-u, -U) with num lines of context. Create a context diff (-c, -C) with num lines of context. The number of context lines defaults to 3.
  • -z[new_name] โ€” create a new patch containing the changes instead of refreshing the topmost patch. If no new name is specified, -2 is added to the original patch name, etc. (See the fork command.)
  • --no-timestamps โ€” do not include file timestamps in patch headers.
  • --no-index โ€” do not output Index: lines.
  • --diffstat โ€” add a diffstat section to the patch header, or replace the existing diffstat section.
  • -f โ€” enforce refreshing of a patch that is not on top.
  • --backup โ€” create a backup copy of the old version of a patch as patch~.
  • --sort โ€” sort files by their name instead of preserving the original order.
  • --strip-trailing-whitespace โ€” strip trailing whitespace at the end of lines.

remove ๐Ÿ—‘๏ธ

remove [-P patch] {file} ...

remove ๐Ÿ™ˆ

okay so this one yeets one or more files off the topmost patch, or off a patch you name yourself. Files that are modified by patches sitting on top of the specified patch? nope, can't be removed, they're protected bestie ๐Ÿ’…

  • -P patch โ€” remove the named files from the named patch instead of the topmost one.

rename ๐ŸŽ€

rename [-P patch] new_name

Rename the topmost patch โ€” or a named one. Giving your patch a glow-up, honestly iconic.

  • -P patch โ€” the patch you want to rename.

revert โ†ฉ๏ธ

revert [-P patch] {file} ...

Undo uncommitted changes to the topmost patch (or a named one) for the file(s) you list. After the revert, quilt diff -z will show no differences for those files. But heads up: changes to files that are modified by patches stacked on top of the specified patch cannot be reverted. no cap.

  • -P patch โ€” revert changes in the named patch.

series ๐Ÿ“œ

series [--color[=always|auto|never]] [-v]

Print the names of all the patches in the series file. the whole roster, the full lineup โœจ

  • --color[=always|auto|never] โ€” turn on syntax coloring. auto only activates it when the output is a tty (so it doesn't get weird in a pipe).
  • -v โ€” verbose, way more user-friendly output.

setup ๐Ÿ› ๏ธ

setup [-d path-prefix] [-v] [--sourcedir dir] [--fuzz=N] [--spec-filter FILTER] [--slow|--fast] {specfile|seriesfile}

Initializes a source tree โ€” from an rpm spec file or a quilt series file. it's giving "birth of a working tree" ๐ŸŒฑ

  • -d โ€” optional path prefix for the resulting source tree.
  • --sourcedir โ€” the directory that contains the package sources. Defaults to ..
  • -v โ€” verbose debug output.
  • --fuzz=N โ€” set the maximum fuzz factor. (needs rpm 4.6 or later, just so you know.)
  • --spec-filter FILTER โ€” before handing the spec file over to rpmbuild for processing, apply a filter to it. FILTER must be an executable script that reads the original spec file from stdin and writes the filtered spec file to stdout. You can give FILTER as a path to a custom script, or as a simple name โ€” in which case it references one of the filter scripts shipped with quilt.
  • --slow โ€” use the original, slow method to process the spec file. In this mode, rpmbuild generates a working tree in a temporary directory while all its actions are recorded, and then everything is replayed from scratch in the target directory.
  • --fast โ€” use the new, faster method. In this mode, rpmbuild is told to generate a working tree directly in the target directory. This is the default (since quilt version 0.67). slay.
โš ๏ธ The setup command is only guaranteed to work properly on spec files where applying all the patches is the last thing done in the %prep section. This is a design limitation, and it's purely because quilt can only operate on patches. If other commands in the %prep section modify the patched files, they must come first โ€” otherwise you won't be able to push the patch series. ๐Ÿ’€

Like, for example: a %prep section where you first unpack a tarball, then apply patches, and lastly perform a tree-wide string substitution? not OK. For quilt setup to work, it would have to be changed to unpacking the tarball, then performing the tree-wide string substitution, and lastly applying the patches. order matters bestie ๐Ÿซถ


snapshot ๐Ÿ“ธ

snapshot [-d]

Take a snapshot of the current working state. After taking the snapshot, the tree can be modified in the usual ways โ€” including pushing and popping patches. A diff against the tree at the moment of the snapshot can be generated with quilt diff --snapshot.

  • -d โ€” only remove the current snapshot.

top ๐Ÿ‘‘

top

Print the name of the topmost patch on the current stack of applied patches. main character energy, obviously.


unapplied ๐ŸŒ™

unapplied [patch]

Print a list of patches that are not applied โ€” or, if you name a patch, all patches that follow the specified patch in the series file.


upgrade โฌ†๏ธ

upgrade

Upgrade the meta-data in a working tree from an old version of quilt to the current version. You only ever need this when the quilt meta-data format has changed and your working tree still has old-format meta-data floating around. In that case, quilt will literally request that you run quilt upgrade. it asks, you obey ๐Ÿ’…


โœจ OPTIONS โœจ

These options are common to all quilt commands. universal besties.

  • -h โ€” print a usage message (for the given command, if one is specified, otherwise for quilt itself) and exit.
  • --quiltrc file โ€” use file as the configuration file instead of ~/.quiltrc (or /etc/quilt.quiltrc if ~/.quiltrc does not exist). The special value โ€œ-โ€ causes quilt to not read any configuration file at all. ๐Ÿ™…
  • --trace โ€” run the command in the shell's trace mode (-x) for debugging of internal operations. peek behind the curtain ๐Ÿฆ‹
  • --version โ€” print the version number and exit.

๐Ÿšฆ EXIT STATUS ๐Ÿšฆ

The exit status is 0 if the requested operation completed successfully, or 1 in case of error.

An exit status of 2 means quilt did not do anything to complete the command. This happens in particular when you ask quilt to push while the whole stack is already pushed, or to pop while the whole stack is already popped. This behavior is intentional โ€” it's there to make scripting with quilt easier. iykyk. ๐Ÿ’–


๐ŸŒˆ ENVIRONMENT ๐ŸŒˆ

Quilt recognizes the following variables:

  • EDITOR โ€” specify the program to run to edit files; for instance, with quilt edit or quilt header -e.
  • LESS โ€” specify the arguments used to invoke the less(1) pager. Defaults to -FRSX.

โœจ FILES โœจ

๐ŸŒณ Example of working tree ๐ŸŒณ

Here's the vibe of a working tree, bestie:

project-1.2.3/
โ”œโ”€โ”€ patches/
โ”‚    โ”œโ”€โ”€ series         (list of patches to apply)
โ”‚    โ”œโ”€โ”€ patch1.diff    (one particular patch)
โ”‚    โ”œโ”€โ”€ patch2.diff
โ”‚    โ””โ”€โ”€ ...
โ”œโ”€โ”€ .pc/
โ”‚    โ”œโ”€โ”€ .quilt_patches (content of QUILT_PATCHES)
โ”‚    โ”œโ”€โ”€ .quilt_series  (content of QUILT_SERIES)
โ”‚    โ”œโ”€โ”€ patch1.diff/   (copy of patched files)
โ”‚    โ”‚    โ””โ”€โ”€ ...
โ”‚    โ”œโ”€โ”€ patch2.diff/
โ”‚    โ”‚    โ””โ”€โ”€ ...
โ”‚    โ””โ”€โ”€ ...
โ””โ”€โ”€ ...

The patches directory is precious, fr fr โ€” it contains all your patches as well as the order in which they should be applied.

The .pc directory contains metadata about the current state of your patch series. Changing its content is not advised. This directory can usually be regenerated from the initial files and the content of the patches directory (provided that all patches were regenerated before the removal).

โš™๏ธ Configuration file โš™๏ธ

Upon startup, quilt evaluates the file specified with the --quiltrc option; if that option is not given, the file .quiltrc in the user's home directory is used, and if that does not exist, /etc/quilt.quiltrc is read. This file is a bash(1) script. EDITOR and LESS can be overridden here if desired; see ENVIRONMENT, above.

Define a variable of the form QUILT_COMMAND_ARGS to specify default options to be passed to any quilt command (in uppercase). For example,

QUILT_DIFF_ARGS="--color=auto"

causes the output of quilt diff to be syntax-colored when writing to a terminal.

  • 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, recent versions of GNU patch support the --reject-format=unified option for generating reject files in โ€œunified diffโ€ style (older patch versions used --unified-reject-files for that).

You may also want to add the -E option if you have issues with quilt not deleting empty files when you think it should. The documentation of GNU patch says that โ€œnormally this option is unnecessaryโ€, but when patch is in POSIX mode or if the patch format doesn't distinguish empty files from deleted files, patch deletes empty files only if the -E option is given. Beware that when passing -E to patch, quilt will no longer be able to deal with empty files, which is why using -E is no longer the default.

  • QUILT_DIFFSTAT_OPTS โ€” indicates additional options that quilt shall pass to diffstat(1) 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_PC โ€” The location of backup files and any other data relating to the current state of the working directory from quilt's perspective. Defaults to .pc.
  • 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 โ€” Boolean flag; if set to anything, quilt will prefix any patch name it prints with its directory (QUILT_PATCHES).
  • QUILT_NO_DIFF_INDEX โ€” Boolean flag; if set to anything, no Index: line is prepended to patches generated by quilt. This is shorthand for adding --no-index to both QUILT_DIFF_ARGS and QUILT_REFRESH_ARGS.
  • QUILT_NO_DIFF_TIMESTAMPS โ€” Boolean flag; if set to anything, no timestamps are included in headers when generating patches. This is shorthand for adding --no-timestamps to both QUILT_DIFF_ARGS and QUILT_REFRESH_ARGS.
  • QUILT_PAGER โ€” The pager quilt shall use for commands which produce paginated output. If unset, the value of GIT_PAGER or, failing that, PAGER is used. If none of these variables is set, less -R is used. An empty value indicates that no pager should be used.
  • QUILT_COLORS โ€” A sequence of definitions that directs quilt which ANSI escape sequences to associate with an output context, overriding the defaults. The most common use is to set colors (thus the name of this variable), but other attributes exist, such as bold or reverse.

To override one or more settings, set QUILT_COLORS to a colon-separated list of elements, each of the form format-name=digit-sequence[;...].

Each digit-sequence should be a SGR (Select Graphic Rendition) value supported by your terminal. The standardized SGR values were specified by ANSI and incorporated into ISO-6429 and ECMA-48 (ยง8.3.117). The colors have standard names but their values were not defined within a color space; their precise appearance will vary and may be customizable in your terminal (emulator).

Recognized format-names, along with the quilt commands that use them, their use contexts, and default values, follow.

  • diff_add โ€” command diff; context: added lines; default: 36 (cyan)
  • diff_cctx โ€” command diff; context: asterisk sequences; default: 33 (yellow)
  • diff_ctx โ€” command diff; context: text after hunk; default: 35 (magenta)
  • diff_hdr โ€” command diff; context: index line; default: 32 (green)
  • diff_hunk โ€” command diff; context: hunk header; default: 33 (yellow)
  • diff_mod โ€” command diff; context: modified lines; default: 35 (magenta)
  • diff_rem โ€” command diff; context: removed lines; default: 35 (magenta)
  • patch_fail โ€” command push; context: failure message; default: 31 (red)
  • patch_fuzz โ€” command push; context: fuzz information; default: 35 (magenta)
  • patch_offs โ€” command push; context: offset information; default: 33 (yellow)
  • series_app โ€” command series; context: applied patch names; default: 32 (green)
  • series_top โ€” command series; context: top patch name; default: 33 (yellow)
  • series_una โ€” command series; context: unapplied patch names; default: 0 (none)

All format-names used by the series command are also used by the patches command.

The special format-name clear is used to turn off special graphic renditions and return to the terminal defaults. Changing its definition should not be necessary for any terminal that claims to support ANSI escape sequences. If your terminal is corrupted despite your best efforts, try the command tput sgr0 to restore the default graphic rendition.

As an example, one can put the following in ~/.quiltrc (or /etc/quilt.quiltrc):

QUILT_DIFF_ARGS="--color"
# Render diff file headers in bold blue over yellow.
# Render diff hunk headers in "negative image" yellow.
# Render failed patches with a red background.
QUILT_COLORS="diff_hdr=1;34;43:diff_hunk=7;33:patch_fail=41"

๐Ÿ‘‘ AUTHORS ๐Ÿ‘‘

Quilt started as a series of scripts written by Andrew Morton (patch-scripts). Based on Andrew's ideas, Andreas Grรผnbacher completely rewrote the scripts, with the help of several other contributors (see the file AUTHORS in the distribution).

This man page was written by Martin Quinson, based on information found in the PDF documentation, and in the help message of each command.

๐Ÿงช EXAMPLES ๐Ÿงช

Please refer to the PDF documentation for a full example of use (under SEE ALSO below).

๐Ÿ‘€ SEE ALSO ๐Ÿ‘€

How to Survive with Many Patches, or: Introduction to Quilt is installed at /usr/share/doc/quilt/quilt.pdf. Note that some distributors compress this file. zxpdf(1) can be used to display compressed PDF files.

The GNU Diffutils manual, Comparing and Merging Files, documents diff and patch in detail.

Control Functions for Coded Character Sets (ECMA-48) specifies the ANSI escape sequences used by QUILT_COLORS; section 8.3.117 will be of the most interest. See console_codes(4) for a more convenient, if less canonical, resource.

diff(1), diffstat(1), guards(1), patch(1)


and that's the tea, bestie ๐Ÿ’… โ€” this page is from quilt, dated Dec 17, 2013, in section quilt(1). Slay. โœจ

๐Ÿ“ฆ where this page comes from