aboutsummaryrefslogtreecommitdiffhomepage
path: root/docs/manpages/gbp-pq.xml
blob: 2bc9a20c8b36abcd5b526d3bd72242200c02bc38 (plain)
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
<refentry id="man.gbp.pq">
  <refentryinfo>
    <address>
      &dhemail;
    </address>
    <author>
      &dhfirstname;
      &dhsurname;
    </author>
  </refentryinfo>
  <refmeta>
   <refentrytitle>gbp-pq</refentrytitle>
    &dhsection;
  </refmeta>
  <refnamediv>
    <refname>gbp-pq</refname>
    <refpurpose>Manage quilt patches on patch queue branches in git</refpurpose>
  </refnamediv>
  <refsynopsisdiv>
    <cmdsynopsis>
      &gbp-pq;
      &man.common.options.synopsis;
      <arg><option>--[no-]patch-numbers</option></arg>
      <arg><option>--patch-num-format=</option><replaceable>format</replaceable></arg>
      <arg><option>--[no-]renumber</option></arg>
      <arg><option>--topic=</option><replaceable>topic</replaceable></arg>
      <arg><option>--time-machine=</option><replaceable>num</replaceable></arg>
      <arg><option>--[no-]drop</option></arg>
      <arg><option>--abbrev=</option><replaceable>num</replaceable></arg>
      <arg><option>--force</option></arg>
      <arg><option>--commit</option></arg>
      <arg><option>--meta-closes=bug-close-tags</option></arg>
      <arg><option>--meta-closes-bugnum=bug-number-format</option></arg>
      <arg><option>--pq-from=</option><replaceable>[DEBIAN|TAG]</replaceable></arg>
      <arg><option>--upstream-tag=</option><replaceable>tag-format</replaceable></arg>
      <arg><option>--[no-]ignore-new</option></arg>
      <group choice="plain">
        <arg><option>drop</option></arg>
        <arg><option>export</option></arg>
        <arg><option>import</option></arg>
        <arg><option>rebase</option></arg>
        <arg><option>switch</option></arg>
      </group>
    </cmdsynopsis>
  </refsynopsisdiv>
  <refsect1>
    <title>DESCRIPTION</title>
    <para>
    &gbp-pq; helps one to manage quilt patches in &debian; packages that are
    maintained with &gbp;. This is especially useful with packages using the
    3.0 (quilt) source format. With &gbp-pq;, you can maintain the quilt patches
    that should be applied to a package on a separate branch called patch-queue
    branch. So if your &debian; package lives on
    <replaceable>master</replaceable>, the associated patch-queue branch will be
    called <replaceable>patch-queue/master</replaceable>.
    </para>
    <para>
    See <ulink url="https://honk.sigxcpu.org/projects/git-buildpackage/manual-html/gbp.patches.html"></ulink>
    for example workflows.
    </para>
  </refsect1>
  <refsect1>
    <title>ACTIONS</title>
    <variablelist>
      <varlistentry>
        <term><option>import</option>
        </term>
        <listitem>
          <para>
          Create a patch queue branch from quilt patches in debian/patches/
          that are listed in debian/patches/series. The patches must apply
          without fuzz.
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>export</option>
        </term>
        <listitem>
          <para>
          Export the patches on the patch-queue branch associated to the
          current branch into a quilt patch series in debian/patches/ and
          update the series file.
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>rebase</option>
        </term>
        <listitem>
          <para>
          Switch to the patch-queue branch associated to the current branch and
          rebase it against the current branch.
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>drop</option>
        </term>
        <listitem>
          <para>
          Drop (delete) the patch queue associated to the current branch. So if
          you're on branch <replaceable>foo</replaceable>, this would drop
          branch <replaceable>patch-queue/foo</replaceable>.
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>apply</option>
        </term>
        <listitem>
          <para>
          Add a single patch to the patch-queue similar to using
          <command>git-am</command>. Use <option>--topic</option> if you want
          the patch to appear in a separate subdir when exporting the patch queue
          using <option>export</option>. This can be used to separate upstream
          patches from &debian; specific patches.
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>switch</option>
        </term>
        <listitem>
          <para>
          Switch to the patch-queue branch if on the base branch and switch
          to base branch if on patch-queue branch.
          </para>
        </listitem>
      </varlistentry>
    </variablelist>
  </refsect1>
  <refsect1>
    <title>OPTIONS</title>
    <variablelist>
      &man.common.options.description;

      <varlistentry>
        <term><option>--[no-]patch-numbers</option>
        </term>
        <listitem>
          <para>
          Whether or not the patch files should be prefixed with a number.
          The default is to export patches with patch numbers. Note,
          however, that this normally affects patches whose names are
          automatically generated, and has no effect on exporting patches
          which have a <option>Gbp[-Pq]: Name</option> tag, since the
          name specified is preserved unless the <option>--renumber</option>
          option is used.
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--patch-num-format=</option><replaceable>format</replaceable>
        </term>
        <listitem>
          <para>
          The format specifier for patch number prefixes. The default format is '%04d-'.
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--[no-]renumber</option>
        </term>
        <listitem>
          <para>
          Whether or not to renumber patches exported from the patch queue,
          instead of preserving numbers specified in
          <option>Gbp-Pq: Name</option> tags. The default is not to renumber
          patches. Useful when patches need to be renamed for the sake of
          uniformity. For example, using <option>--renumber</option> with
          <option>--no-patch-num</option> will strip all numeric prefixes from
          exported patches.
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--topic=</option><replaceable>topic</replaceable>
        </term>
        <listitem>
          <para>
          Topic to use when importing a single patch
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--time-machine=</option><replaceable>NUM</replaceable>
        </term>
        <listitem>
          <para>
          When importing a patch queue fails, go back commit-by-commit on the
          current branch to check if the patch-queue applies there. Do this at
          most <replaceable>NUM</replaceable> times. This can be useful if the
          patch-queue doesn't apply to the current branch HEAD anymore, e.g.
          after importing a new upstream version.
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--[no-]drop</option></term>
        <listitem>
          <para>Whether to automatically drop (delete) the patch queue branch after
          a successful export</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--abbrev=</option><replaceable>NUM</replaceable>
        </term>
        <listitem>
          <para>
	  When exporting a patch queue abbreviate commit, instead of showing the
	  full 40-byte hexadecimal object name in header lines, show only a
	  partial prefix of length <replaceable>NUM</replaceable>. This is
	  useful when existing patches were not generated by &gbp-pq;.
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--force</option></term>
        <listitem>
          <para>In case of <option>import</option>, import even if the
            patch-queue branch already exists and overwrite its
            content with <filename>debian/patches</filename>.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--commit</option></term>
        <listitem>
          <para>
	    In case of <option>export</option>, commit
            <filename>debian/patches</filename>the changes to &git; after
	    exporting the patches.
	  </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--meta-closes=</option><replaceable>bug-close-tags</replaceable>
        </term>
        <listitem>
          <para>
          What meta tags to look for to generate a commit message when
          using <option>export</option> <option>--commit</option>.
          The default is <literal>'Closes|LP'</literal> to support Debian and Launchpad.
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--meta-closes-bugnum=</option><replaceable>bug-number-format</replaceable>
        </term>
        <listitem>
          <para>
            What regular expression should be used to parse out the
            bug number when using
	    <option>export</option> <option>--commit</option>.  The
            default is <literal>'(?:bug|issue)?\#?\s?\d+'</literal>.
            See <xref linkend="man.gbp.dch"/> for details.
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--pq-from=</option><replaceable>[DEBIAN|TAG]</replaceable>
        </term>
        <listitem>
          <para>
          How to find the starting point for the patch queue base. The options are DEBIAN, that will use the Debian branch as the base for the patch queue branch, and TAG, that will use the corresponding upstream tag as a base for the patch queue branch.
          </para>
          <para>
          This is only needed if your upstream branch is not merged in the Debian branch.
          The default is <replaceable>DEBIAN</replaceable>.
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--upstream-tag=</option><replaceable>TAG-FORMAT</replaceable>
        </term>
        <listitem>
          <para>
          Use this tag format when looking for tags of upstream versions,
          default is <replaceable>upstream/%(version)s</replaceable>.
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--[no-]ignore-new</option>
        </term>
        <listitem>
          <para>
            Don't abort if there are uncommitted changes in the source tree or
            the current branch doesn't match the
            <replaceable>DEBIAN-BRANCH</replaceable>.
          </para>
        </listitem>
      </varlistentry>
     </variablelist>
  </refsect1>
  <refsect1>
    <title>TAGS</title>
    <para>
    When exporting patches from a patch-queue branch, &gbp-pq; will look at the
    patch header for special tags it recognizes. All tags need to start at the
    first column and require at least one whitespace after the colon.
    </para>
    <variablelist>
      <varlistentry>
        <term><option>Gbp[-Pq]: Ignore</option>
        </term>
        <listitem>
          <para>
          Ignores the commit, no patch is generated out of it.
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>Gbp[-Pq]: Name</option> <replaceable>name</replaceable>
        </term>
        <listitem>
          <para>
	    The name to use for the patch when running
	    <screen>&gbp-pq; export</screen>
	    If unset, it will be formatted like
	    <command>git am</command> would format it.
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>Gbp[-Pq]: Topic</option> <replaceable>topic</replaceable>
        </term>
        <listitem>
          <para>
          Moves the patch into a subdir called <replaceable>topic</replaceable>
          when running <screen>&gbp-pq; export</screen> This allows for some
          structure below <filename>debian/patches</filename>.
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>Gbp-Pq-Topic:</option> <replaceable>topic</replaceable>
        </term>
        <listitem>
          <para>
          Deprecated: use <option>Gbp[-Pq]: Topic</option>
          <replaceable>topic</replaceable> instead.
          </para>
        </listitem>
      </varlistentry>
    </variablelist>
  </refsect1>
  <refsect1>
    <title>SEE ALSO</title>
    <para>
      <xref linkend="man.gbp.buildpackage"/>,
      <citerefentry>
        <refentrytitle>dpkg-source</refentrytitle>
        <manvolnum>1</manvolnum>
      </citerefentry>,
      <citerefentry>
        <refentrytitle>quilt</refentrytitle>
        <manvolnum>1</manvolnum>
      </citerefentry>,
      <xref linkend="man.gbp.conf"/>
    </para>
  </refsect1>
  <refsect1>
    <title>AUTHOR</title>
    <para>
      &dhusername; &dhemail;
    </para>
  </refsect1>
</refentry>