chiark / gitweb /
git-debrebase(1): document options
[dgit.git] / git-debrebase.1.pod
1 =head1 NAME
2
3 git-debrebase - delta queue rebase tool for Debian packaging
4
5 =head1 SYNOPSYS
6
7  git-debrebase [<options...>] [-- <git-rebase options...>]
8  git-debrebase [<options...>] <operation> [<operation options...>
9
10 =head1 INTRODUCTION
11
12 git-debrebase is a tool for representing in git,
13 and manpulating,
14 Debian packages based on upstream source code.
15
16 This is the command line reference.
17 Please read the tutorial
18 L<dgit-maint-debrebase(5)>.
19 For background, theory of operation,
20 and definitions of the terms used here,
21 see L<git-debrebase(5)>.
22
23 If no operation is specified,
24 git-debrebase launders the branch and rebases the Debian delta queue.
25 See below.
26
27 =head1 PRINCIPAL OPERATIONS
28
29 =over
30
31 =item git-debrebase [-- <git-rebase options...>]
32
33 Unstitches and launders the branch.
34 (See L</UNSTITCHING AND LAUNDERING> below.)
35
36 Then optionally edits the Debian delta queue,
37 using git-rebase, by running
38
39     git rebase <git-rebase options> <breakwater-tip>
40
41 Do not pass a base branch argument:
42 git-debrebase will supply that.
43 Do not use --onto, or --fork-point.
44 Useful git-rebase options include -i and --autosquash.
45
46 If git-rebase stops for any reason,
47 you may git-rebase --abort, --continue, or --skip, as usual.
48 If you abort the git-rebase,
49 the branch will still have been laundered,
50 but everything in the rebase will be undone.
51
52 =item git-debrebase stitch [--prose=<for commit message>]
53
54 Stitch the branch,
55 consuming ffq-prev.
56
57 If there is no ffq-prev, it is an error, unless --noop-ok.
58
59 =item git-debrebase new-upstream-v0 <new-version> [<upstream-details>...]
60
61 Rebases the delta queue
62 onto a new upstream version.  In detail:
63
64 Firstly, checks that the proposed rebase seems to make sense:
65 It is a problem unless the new upstream(s)
66 are fast forward from the previous upstream(s)
67 as found in the current breakwater anchor.
68 And, in the case of a multi-piece upstream,
69 if the pieces are not in the same order, with the same names.
70
71 If all seems well, unstitches and launders the branch.
72
73 Then,
74 generates
75 (in a private working area)
76 a new anchor merge commit,
77 on top of the breakwater tip,
78 and on top of that a commit to
79 update the version number in debian/changelog.
80
81 Finally,
82 starts a git-rebase
83 of the delta queue onto these new commits.
84
85 That git-rebase may complete successfully,
86 or it may require your assistance,
87 just like a normal git-rebase.
88
89 If you git-rebase --abort,
90 the whole new upstream operation is aborted,
91 but the laundering will still have been done.
92
93 The <upstream-details> are, optionally, in order:
94
95 =over
96
97 =item <upstream-commitish>
98
99 The new upstream branch (or commitish).
100 Default is C<upstream>.
101
102 It is a problem if the upstream contains a debian/ directory;
103 if forced to proceed,
104 git-debrebase will disregard the upstream's debian/ and
105 take (only) the packaging from the current breakwater.
106
107 =item <piece-name> <piece-upstream-commitish>
108
109 Specifies that this is a multi-piece upstream.
110 (A multi-component upstream, in dpkg-source terminology.)
111 May be repeated.
112
113 When such a pair is specified,
114 git-debrebase will first combine the pieces of the upstream
115 together,
116 and then use the result as the combined new upstream.
117
118 For each <piece-name>,
119 the tree of the <piece-upstream-commitish>
120 becomes the subdirectory <piece-name>
121 in the combined new upstream
122 (supplanting any subdirectory that might be there in
123 the main upstream branch).
124
125 <piece-name> has a restricted syntax:
126 it may contain only ASCII alphanumerics and hyphens.
127
128 The combined upstream is itself recorded as a commit,
129 with each of the upstream pieces' commits as parents.
130 The combined commit contains an annotation
131 to allow a future git-debrebase new upstream operation
132 to make the coherency checks described above.
133
134 =item <git-rebase options>
135
136 These will be passed to git rebase.
137
138 If the upstream rebase is troublesome, -i may be helpful.
139 As with plain git-debrebase,
140 do not specify a base, or --onto, or --fork-point.
141
142 =back
143
144 If you are planning to generate a .dsc,
145 you will also need to have, or generate,
146 actual orig tarball(s),
147 which must be identical to the rev-spec(s)
148 passed to git-debrebase.
149 git-debrebase does not concern itself with source packages
150 so neither helps with this, nor checks it.
151 L<git-archive(1)>, L<dgit(1)> and L<gbp(1)> may be able to help.
152
153 This subcommand has -v0 in its name because we are not yet sure
154 that its command line syntax is optimal.
155 We may want to introduce an incompatible replacement syntax
156 under the name C<new-upstream>.
157
158 =item git-debrebase convert-from-gbp [<upstream-commitish>]
159
160 Cnnverts a gbp patches-unapplied branch
161 (not a gbp pq patch queue branch)
162 into a git-debrebase interchange branch.
163
164 This is done by generating a new anchor merge,
165 converting the quilt patches as a delta queue,
166 and dropping the patches from the tree.
167
168 The upstream commitish should correspond to
169 the gbp upstream branch.
170 It is a problem if it is not an ancestor of HEAD,
171 or if the history between the upstream and HEAD
172 contains commits which make changes to upstream files.
173
174 It is also a problem if the specified upstream
175 has a debian/ subdirectory.
176 This check exists to detect certain likely user errors,
177 but if this situation is true and expected,
178 forcing it is fine.
179
180 The result is a well-formed git-debrebase interchange branch.
181 The result is also fast-forward from the gbp branch.
182
183 Note that it is dangerous not to know whether you are
184 dealing with a gbp patches-unappled branch containing quilt patches,
185 or a git-debrebase interchange branch.
186 At worst,
187 using the wrong tool for the branch format might result in
188 a dropped patch queue!
189
190 =back
191
192 =head1 UNDERLYING AND SUPPLEMENTARY OPERATIONS
193
194 =over
195
196 =item git-debrebase breakwater
197
198 Prints the breakwater tip commitid.
199 Fails if your HEAD branch is not laundered.
200
201 =item git-debrebase analyse
202
203 Walks the history of the current branch,
204 most recent commit first,
205 back until the most recent anchor,
206 printing the commit object id,
207 and commit type and info
208 (ie the semantics in the git-debrebase model)
209 for each commit.
210
211 =item git-debrebase record-ffq-prev
212
213 Establishes the current branch's ffq-prev,
214 as discussed in L</UNSTITCHING AND LAUNDERING>,
215 but does not launder the branch or move HEAD.
216
217 It is an error if the ffq-prev could not be recorded.
218 It is also an error if an ffq-prev has already been recorded,
219 unless --noop-ok.
220
221 =item git-debrebase launder-v0
222
223 Launders the branch without recording anything in ffq-prev.
224 Then prints some information about the current branch.
225 Do not use this operation;
226 it will be withdrawn soon.
227
228 =item git-debrebase convert-to-gbp
229
230 Converts a laundered branch into a
231 gbp patches-unapplied branch containing quilt patches.
232 The result is not fast forward from the interchange branch,
233 and any ffq-prev is deleted.
234
235 This is provided mostly for the test suite
236 and for unusual situations.
237 It should only be used with a care and 
238 with a proper understanding of the underlying theory.
239
240 Be sure to not accidentally treat the result as
241 a git-debrebase branch,
242 or you will drop all the patches!
243
244 =back
245
246 =head1 OPTIONS
247
248 This section documents the general options
249 to git-debrebase
250 (ie, the ones which follow git-debrebase).
251 Individual operations may have their own options which are
252 docuented under each operation.
253
254 =over
255
256 =item -f<problem-id>
257
258 Turns problems with id <problem-id> into warnings.
259
260 Some troublesome things which git-debrebase encounters
261 are B<problem>s.
262 (The specific instances are discussed
263 in the text for the relvant operation.)
264
265 When a problem is detected,
266 a message is printed to stderr containing the problem id
267 (in the form C<-f<problem-idE<gt>>),
268 along with some prose.
269
270 If problems are detected, git-debrebase does not continue,
271 unless the relevant -f<problem-id> is specified,
272 or --force is specified.
273
274 =item --force
275
276 Turns all problems into warnings.
277 See the -f<problem-id> option.
278
279 Do not invoke git-debrebase --force in scripts and aliases;
280 instead, specify the particular -f<problem-id> for expected problems.
281
282 =item --noop-ok
283
284 Suppresses the error in
285 some situations where git-debrebase does nothing,
286 because there is nothing to do.
287
288 The specific instances are discussed
289 in the text for the relvant operation.
290
291 =item --anchor=<commitish>
292
293 Treats <commitish> as an anchor,
294 regardless of what it's actually like.
295
296 (It is a problem for
297 git-debrebase new-upstream operations
298 if <commitish> is the previous anchor to be used,
299 because treating an arbitrary commit as an anchor
300 means forgoing upstream coherency checks.)
301
302 =item -D
303
304 Requests (more) debugging.  May be repeated.
305
306 =back
307
308 =head1 UNSTITCHING AND LAUNDERING
309
310 Several operations unstitch and launder the branch first.
311 In detail this means:
312
313 =head2 Establish the current branch's ffq-prev
314
315 If it is not yet recorded,
316 git-debrebase checks that the current branch is ahead of relevant
317 remote tracking branches.
318
319 The remote tracking branches checked by default are
320 obtained from the git config.
321 In each case it is a problem if
322 the local HEAD is behind the checked remote,
323 or if local HEAD has diverged from it.
324 All the checks are done locally using the remote tracking refs:
325 git-debrebase does not fetch anything from anywhere.
326
327 git-debrebase checks the branch that git would merge from
328 (remote.<branch>.merge, remote.<branch>.remote)
329 and the branch git would push to
330 (remote.<branch>.pushRemote etc.).
331 For local dgit suite branches
332 it checks the corresponding tracking remote.
333 If you are on C<master>, it checks remotes/dgit/dgit/sid.
334 The resulting ref names to check are filtered through
335 branch.<branch>.ffq-ffrefs,
336 which is a semicolon-separated list of glob patterns,
337 each optionally preceded by !; first match wins.
338
339 If these checks pass,
340 or are forced,
341 git-debrebse then records the current tip as ffq-prev.
342
343 =head2 Examine the branch
344
345 git-debrebase
346 analyses the current HEAD's history to find the anchor
347 in its breakwater,
348 and the most recent breakwater tip.
349
350 =head2 Rewrite the commits into laundered form
351
352 Mixed debian+upstream commits are split into two commits each.
353 Delta queue (upstream files) commits bubble to the top.
354 Pseudomerges,
355 and quilt patch additions,
356 are dropped.
357
358 This rewrite will always succeed, by construction.
359 The result is the laundered branch.
360
361 =head1 SEE ALSO
362
363 git-debrebase(1),
364 dgit-maint-rebase(7),
365 dgit(1)