summaryrefslogtreecommitdiffstats
path: root/doc/quilt.1.in
blob: 62336898f1a937943b3df4b7cb01abad33018c2f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
.\"Created by Martin Quinson from the tex documentation
.\"
.TH quilt 1 "February 21, 2004" "quilt"
 
.SH NAME
quilt \- tool to manage series of patches

.SH SYNOPSIS
.B quilt
[-h] command [options]

.SH 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 invoqued from anywhere within the source tree. They are of the form
.B 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
.B 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 
.RB ( "quilt push" ),
and popped off the stack
.RB ( "quilt pop" ).  
Commands are available for querying the contents of the series file 
.RB ( "quilt series" ,
see below), the contents of the stack 
.RB ( "quilt applied" , " quilt previous" , " quilt top" ),
and the patches that are not applied at a particular moment 
.RB ( "quilt next" , " quilt unapplied" ).
By default, most commands apply to the topmost patch on the stack.

Patch files are located in the 
.I patches
sub-directory of the source tree (see EXAMPLE OF WORKING TREE below). The 
.I QUILT_PATCHES
environment variable can be used to override this location. The
.I patches
directory may contain sub-directories. It may also be a symbolic link
instead of a directory. 

A file called
.I 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
.I patches
directory; patches may be in sub-directories below the this directory. Lines
in the series file that start with a hash character (#) are ignored. 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 
.RI .pc/ patch
directory. The patch is added to the list of currently applied patches
(.pc/applied-patches). Later when a patch is regenerated 
.RB ( "quilt refresh" ),
the backup copies in 
.RI .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
.B diff
documentation).

The series file is looked up in the root of the source tree, in the patches
directory, and in the .pc 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 
.RB ( "quilt pop" ),
and refreshing patches 
.RB ( "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.

.SH QUILT COMMANDS REFERENCE

@REFERENCE@

.SH EXAMPLE OF WORKING TREE

.nf
   +- work/ -+- ...
   |         |- patches/ -+- series
   |         |            |- patch2.diff
   |         |            |- patch1.diff
   |         |            +- ...
   |         +- .pc/ -+- applied-patches
   |                  |- patch1.diff/ -+- ...
   |                  |- patch2.diff/ -+- ...
   |                  +- ...
.fi

.SH EXAMPLE

Please refere to the pdf documentation for an example.

.SH CONFIGURATION FILE

The file ~/.quiltrc is used by default as configuration file, but that can
be changed with the option --quiltrc. This file is to be sourced by bash.
Here are the existing settings and their effects:

.IP QUILT_BACKUP 4

When set to "yes", the quilt refresh command will create backup files when
refreshing patches. The backup files have "~" appended to the patch file
names.

.IP QUILT_DIFF_OPTS 4

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.
    
.IP QUILT_NO_DIFF_TIMESTAMPS 4 

When set to "yes", the quilt diff and quilt refresh commands will not
include file timestamps in patches.
	
.IP QUILT_PATCH_OPTS 4

Additional options that quilt shall pass to GNU patch when applying patches.
(For example, some versions of GNU patch sup- port the
"­unified-reject-files" option for generating reject files in unified diff
style.
    
.IP QUILT_PATCHES 4

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

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

.SH SEE ALSO

The pdf documentation, which should be under /usr/share/doc/quilt/quilt.pdf.

.BR diff ( 1 ),
.BR patch ( 1 ).