summaryrefslogtreecommitdiffhomepage
path: root/docs/manpages/gbp-pq-rpm.xml
blob: c06fb0ab9b1c269999d3d7545ce31effd47a6c8c (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
<refentry id="man.gbp.pq.rpm">
  <refentryinfo>
    <address>
      &rpm-email;
    </address>
    <author>
      &rpm-firstname;
      &rpm-surname;
    </author>
  </refentryinfo>
  <refmeta>
   <refentrytitle>gbp-pq-rpm</refentrytitle>
    &dhsection;
  </refmeta>
  <refnamediv>
    <refname>gbp-pq-rpm</refname>
    <refpurpose>Manage patches and development branches in Git</refpurpose>
  </refnamediv>
  <refsynopsisdiv>
    <cmdsynopsis>
      &gbp-pq-rpm;
      &man.common.options.synopsis;
      <arg><option>--packaging-dir=</option><replaceable>DIRECTORY</replaceable></arg>
      <arg><option>--spec-file=</option><replaceable>FILEPATH</replaceable></arg>
      <arg><option>--upstream-tag=</option><replaceable>TAG-FORMAT</replaceable></arg>
      <arg><option>--abbrev=</option><replaceable>num</replaceable></arg>
      <arg><option>--force</option></arg>
      <arg><option>--[no-]drop</option></arg>
      <arg><option>--[no-]patch-numbers</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>
	<arg><option>apply</option></arg>
      </group>
    </cmdsynopsis>
  </refsynopsisdiv>
  <refsect1>
    <title>DESCRIPTION</title>
    <para>
    &gbp-pq-rpm; helps in managing patches and development branch(es) for
    packages that are maintained with &gbp;. It designed to be used for
    packages that are maintained using the "orphan-packaging" model.
    &gbp-pq-rpm; has multiple subcommands, or actions, for working with the
    branches and patches.
    </para>
    <para>
    &gbp-pq-rpm; makes it easy to do source code development on a separate
    development branch (patch-queue branch in Debian git-buildpackage terms).
    For example, if the packaging files would be stored in
    <replaceable>master</replaceable> the associated development branch would
    be <replaceable>development/master</replaceable>.
    </para>
  </refsect1>
  <refsect1>
    <title>ACTIONS</title>
    <variablelist>
      <varlistentry>
        <term><option>import</option>
        </term>
        <listitem>
          <para>
          Create a development (patch-queue) branch by applying all patches
          from the packaging branch on top of the upstream version. The patches
          must apply without fuzz.
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>export</option>
        </term>
        <listitem>
          <para>
          Export patches from the development branch into the packaging branch.
          It generates patches (one-per-commit) from the development branch and
          updates the spec file accordingly. It doesn't automatically commit
          the changes though - they need to verified and committed manually.
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>rebase</option>
        </term>
        <listitem>
          <para>
          Switch to the development branch and rebase it against the current
          upstream version (indicated in the spec file of the associated
          packaging branch).
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>drop</option>
        </term>
        <listitem>
          <para>
          Drop (delete) the development branch associated to the current
          branch. For example, you're on branch <replaceable>foo</replaceable>
          this would drop branch <replaceable>development/foo</replaceable>.
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>apply</option>
        </term>
        <listitem>
          <para>
          Add a single patch to the development branch - similar to using
          <command>git-am</command>.
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>switch</option>
        </term>
        <listitem>
          <para>
          Switch between the development branch and the associated packaging
          branch.
          </para>
        </listitem>
      </varlistentry>
    </variablelist>
  </refsect1>
  <refsect1>
    <title>OPTIONS</title>
    <variablelist>
      &man.common.options.description;
      <varlistentry>
        <term><option>--packaging-dir=</option><replaceable>DIRECTORY</replaceable>
        </term>
        <listitem>
          <para>
          Subdirectory that contains the RPM packaging files.
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--spec-file=</option><replaceable>FILEPATH</replaceable>
        </term>
        <listitem>
          <para>
          Relative path to the spec file to use. Special value
          <replaceable>auto</replaceable> causes &gbp; to search and guess.
          Other values cause the <option>--packaging-dir</option> option to be
          ignored: the directory of the spec file is used, instead.
          </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>--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>
          Import even if the development (patch-queue) branch already exists.
          Only valid for the import action.
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--[no-]drop</option></term>
        <listitem>
          <para>
          Whether to drop (delete) the patch queue branch after a succesful
          export.
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--[no-]patch-numbers</option>
        </term>
        <listitem>
          <para>
          Whether the patch files should start with a number or not.
          </para>
        </listitem>
      </varlistentry>
    </variablelist>
  </refsect1>
  <refsect1>
    <title>META TAGS</title>
    <para>
    When exporting patches from a patch-queue branch &gbp-pq-rpm; will look at
    the commit message 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-Rpm: Ignore</option>
        </term>
        <listitem>
          <para>
          Ignores the commit, no patch is generated out of it.
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>Gbp-Rpm: If &lt;expression&gt;</option>
        </term>
        <listitem>
          <para>
          Conditional patch. Put patch inside "%if &lt;expression&gt;" in the
          spec file.
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>Gbp-Rpm: IfArch&lt;expression&gt;</option>
        </term>
        <listitem>
          <para>
          Conditional patch. Put patch inside "%ifarch &lt;expression&gt;" in
          the spec file.
          </para>
        </listitem>
      </varlistentry>
    </variablelist>
    <para>
    For example, the following commit message:
    </para>
    <screen>
      Fix around a problem in Fedora

      which is not applicable elsewhere.

      Gbp-Rpm: If 0%{?fedora}
    </screen>
    <para>
    Will result something like this in the spec file:
    </para>
    <screen>
      # 0001-Fix-around-a-problem-in-Fedora.patch
      %if 0%{?fedora}
      %patch0 -p1
      %endif
    </screen>
  </refsect1>
  <refsect1>
    <title>SEE ALSO</title>
    <para>
      <xref linkend="man.gbp.buildpackage.rpm"/>,
      <xref linkend="man.gbp.import.srpm"/>,
      <xref linkend="man.gbp.conf"/>
    </para>
  </refsect1>
  <refsect1>
    <title>AUTHOR</title>
    <para>
      &rpm-username; &rpm-email;
    </para>
  </refsect1>
</refentry>