3 git-debrebase - delta queue rebase tool for Debian packaging
7 git-debrebase [<options...>] [-- <git-rebase options...>]
8 git-debrebase [<options...>] <operation> [<operation options...>
12 git-debrebase is a tool for representing in git,
14 Debian packages based on upstream source code.
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 see L<git-debrebase(5)>.
22 You should read this manpage in conjunction with
23 L<git-debrebase(5)/TERMINOLOGY>,
24 which defines many important terms used here.
26 =head1 PRINCIPAL OPERATIONS
30 =item git-debrebase [-- <git-rebase options...>]
32 =item git-debrebase [-i <further git-rebase options...>]
34 Unstitches and launders the branch.
35 (See L</UNSTITCHING AND LAUNDERING> below.)
37 Then, if any git-rebase options were supplied,
38 edits the Debian delta queue,
39 using git-rebase, by running
41 git rebase <git-rebase options> <breakwater-tip>
43 Do not pass a base branch argument:
44 git-debrebase will supply that.
45 Do not use --onto, or --fork-point.
46 Useful git-rebase options include -i and --autosquash.
48 If git-rebase stops for any reason,
49 you may git-rebase --abort, --continue, or --skip, as usual.
50 If you abort the git-rebase,
51 the branch will still have been laundered,
52 but everything in the rebase will be undone.
54 The options for git-rebase must either start with C<-i>,
55 or be prececded by C<-->,
56 to distinguish them from options for git-debrebase.
58 =item git-debrebase conclude
60 Finishes a git-debrebase session,
61 tidying up the branch and making it fast forward again.
63 Specifically: if the branch is unstitched,
64 launders and restitches it,
65 making a new pseudomerge.
66 Otherwise, it is an error,
69 =item git-debrebase quick
71 Unconditionally launders and restitches the branch,
72 consuming any ffq-prev
73 and making a new pseudomerge.
75 If the branch is already laundered and stitched, does nothing.
77 =item git-debrebase stitch [--prose=<for commit message>]
82 If there is no ffq-prev, it is an error, unless --noop-ok.
84 It is a snag (see B<-f>) if the branch is not laundered.
86 =item git-debrebase new-upstream-v0 <new-version> [<upstream-details>...]
88 Rebases the delta queue
89 onto a new upstream version. In detail:
91 Firstly, checks that the proposed rebase seems to make sense:
92 It is a snag unless the new upstream(s)
93 are fast forward from the previous upstream(s)
94 as found in the current breakwater anchor.
95 And, in the case of a multi-piece upstream
96 (a multi-component upstream, in dpkg-source terminology),
97 if the pieces are not in the same order, with the same names.
99 If all seems well, unstitches and launders the branch.
103 (in a private working area)
104 a new anchor merge commit,
105 on top of the breakwater tip,
106 and on top of that a commit to
107 update the version number in debian/changelog.
111 of the delta queue onto these new commits.
113 That git-rebase may complete successfully,
114 or it may require your assistance,
115 just like a normal git-rebase.
117 If you git-rebase --abort,
118 the whole new upstream operation is aborted,
119 except for the laundering.
121 The <upstream-details> are, optionally, in order:
125 =item <upstream-commit-ish>
127 The new upstream branch (or commit-ish).
128 Default is C<upstream>.
130 It is a snag if the upstream contains a debian/ directory;
131 if forced to proceed,
132 git-debrebase will disregard the upstream's debian/ and
133 take (only) the packaging from the current breakwater.
135 =item <piece-name> <piece-upstream-commit-ish>
137 Specifies that this is a multi-piece upstream.
140 When such a pair is specified,
141 git-debrebase will first combine the pieces of the upstream
143 and then use the result as the combined new upstream.
145 For each <piece-name>,
146 the tree of the <piece-upstream-commit-ish>
147 becomes the subdirectory <piece-name>
148 in the combined new upstream
149 (supplanting any subdirectory that might be there in
150 the main upstream branch).
152 <piece-name> has a restricted syntax:
153 it may contain only ASCII alphanumerics and hyphens.
155 The combined upstream is itself recorded as a commit,
156 with each of the upstream pieces' commits as parents.
157 The combined commit contains an annotation
158 to allow a future git-debrebase new upstream operation
159 to make the coherency checks described above.
161 =item <git-rebase options>
163 These will be passed to git rebase.
165 If the upstream rebase is troublesome, -i may be helpful.
166 As with plain git-debrebase,
167 do not specify a base, or --onto, or --fork-point.
171 If you are planning to generate a .dsc,
172 you will also need to have, or generate,
173 actual orig tarball(s),
174 which must be identical to the rev-spec(s)
175 passed to git-debrebase.
176 git-debrebase does not concern itself with source packages
177 so neither helps with this, nor checks it.
179 L<git-archive(1)>, L<dgit(1)> and
180 L<gbp-import-orig(1)> may be able to help.
182 This subcommand has -v0 in its name because we are not yet sure
183 that its command line syntax is optimal.
184 We may want to introduce an incompatible replacement syntax
185 under the name C<new-upstream>.
187 =item git-debrebase convert-from-gbp [<upstream-commit-ish>]
189 Cnnverts a gbp patches-unapplied branch
190 (not a gbp pq patch queue branch)
191 into a git-debrebase interchange branch.
193 This is done by generating a new anchor merge,
194 converting the quilt patches as a delta queue,
195 and dropping the patches from the tree.
197 The upstream commit-ish should correspond to
198 the gbp upstream branch, if there is one.
199 It is a snag if it is not an ancestor of HEAD,
200 or if the history between the upstream and HEAD
201 contains commits which make changes to upstream files.
203 It is also a snag if the specified upstream
204 has a debian/ subdirectory.
205 This check exists to detect certain likely user errors,
206 but if this situation is true and expected,
209 The result is a well-formed git-debrebase interchange branch.
210 The result is also fast-forward from the gbp branch.
212 Note that it is dangerous not to know whether you are
213 dealing with a gbp patches-unappled branch containing quilt patches,
214 or a git-debrebase interchange branch.
216 using the wrong tool for the branch format might result in
217 a dropped patch queue!
221 =head1 UNDERLYING AND SUPPLEMENTARY OPERATIONS
225 =item git-debrebase breakwater
227 Prints the breakwater tip commitid.
228 If your HEAD branch is not fully laundered,
229 prints the tip of the so-far-laundered breakwater.
231 =item git-debrebase anchor
233 Prints the breakwater anchor commitid.
235 =item git-debrebase analyse
237 Walks the history of the current branch,
238 most recent commit first,
239 back until the most recent anchor,
240 printing the commit object id,
241 and commit type and info
242 (ie the semantics in the git-debrebase model)
245 =item git-debrebase record-ffq-prev
247 Establishes the current branch's ffq-prev,
248 as discussed in L</UNSTITCHING AND LAUNDERING>,
249 but does not launder the branch or move HEAD.
251 It is an error if the ffq-prev could not be recorded.
252 It is also an error if an ffq-prev has already been recorded,
255 =item git-debrebase launder-v0
257 Launders the branch without recording anything in ffq-prev.
258 Then prints some information about the current branch.
259 Do not use this operation;
260 it will be withdrawn soon.
262 =item git-debrebase convert-to-gbp
264 Converts a laundered branch into a
265 gbp patches-unapplied branch containing quilt patches.
266 The result is not fast forward from the interchange branch,
267 and any ffq-prev is deleted.
269 This is provided mostly for the test suite
270 and for unusual situations.
271 It should only be used with a care and
272 with a proper understanding of the underlying theory.
274 Be sure to not accidentally treat the result as
275 a git-debrebase branch,
276 or you will drop all the patches!
282 This section documents the general options
284 (ie, the ones which immediately follow
288 on the command line).
289 Individual operations may have their own options which are
290 docuented under each operation.
296 Turns snag(s) with id <snag-id> into warnings.
298 Some troublesome things which git-debrebase encounters
300 (The specific instances are discussed
301 in the text for the relvant operation.)
303 When a snag is detected,
304 a message is printed to stderr containing the snag id
305 (in the form C<-f<snag-idE<gt>>),
306 along with some prose.
308 If snags are detected, git-debrebase does not continue,
309 unless the relevant -f<snag-id> is specified,
310 or --force is specified.
314 Turns all snags into warnings.
315 See the -f<snag-id> option.
317 Do not invoke git-debrebase --force in scripts and aliases;
318 instead, specify the particular -f<snag-id> for expected snags.
322 Suppresses the error in
323 some situations where git-debrebase does nothing,
324 because there is nothing to do.
326 The specific instances are discussed
327 in the text for the relvant operation.
329 =item --anchor=<commit-ish>
331 Treats <commit-ish> as an anchor.
332 This overrides the usual logic which automatically classifies
333 commits as anchors, pseudomerges, delta queue commits, etc.
335 It also disables some coherency checks
336 which depend on metadata extracted from its commit message,
338 it is a snag if <commit-ish> is the anchor
339 for the previous upstream version in
340 git-debrebase new-upstream operations.
344 Requests (more) debugging. May be repeated.
348 =head1 UNSTITCHING AND LAUNDERING
350 Several operations unstitch and launder the branch first.
351 In detail this means:
353 =head2 Establish the current branch's ffq-prev
355 If ffq-prev is not yet recorded,
356 git-debrebase checks that the current branch is ahead of relevant
357 remote tracking branches.
358 The relevant branches depend on
359 the current branch (and its
367 The branch that git would merge from
368 (remote.<branch>.merge, remote.<branch>.remote);
372 The branch git would push to, if different
373 (remote.<branch>.pushRemote etc.);
377 For local dgit suite branches,
378 the corresponding tracking remote;
382 If you are on C<master>,
383 remotes/dgit/dgit/sid.
387 The apparently relevant ref names to check are filtered through
388 branch.<branch>.ffq-ffrefs,
389 which is a semicolon-separated list of glob patterns,
390 each optionally preceded by !; first match wins.
392 In each case it is a snag if
393 the local HEAD is behind the checked remote,
394 or if local HEAD has diverged from it.
395 All the checks are done locally using the remote tracking refs:
396 git-debrebase does not fetch anything from anywhere.
398 If these checks pass,
400 git-debrebse then records the current tip as ffq-prev.
402 =head2 Examine the branch
405 analyses the current HEAD's history to find the anchor
407 and the most recent breakwater tip.
409 =head2 Rewrite the commits into laundered form
411 Mixed debian+upstream commits are split into two commits each.
412 Delta queue (upstream files) commits bubble to the top.
414 and quilt patch additions,
417 This rewrite will always succeed, by construction.
418 The result is the laundered branch.
423 dgit-maint-rebase(7),