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 Unstitches and launders the branch.
33 (See L</UNSTITCHING AND LAUNDERING> below.)
35 Then optionally edits the Debian delta queue,
36 using git-rebase, by running
38 git rebase <git-rebase options> <breakwater-tip>
40 Do not pass a base branch argument:
41 git-debrebase will supply that.
42 Do not use --onto, or --fork-point.
43 Useful git-rebase options include -i and --autosquash.
45 If git-rebase stops for any reason,
46 you may git-rebase --abort, --continue, or --skip, as usual.
47 If you abort the git-rebase,
48 the branch will still have been laundered,
49 but everything in the rebase will be undone.
51 =item git-debrebase conclude
53 Launder and restitch the branch,
54 consuming any ffq-prev.
56 If the branch is already laundered and stitched, it is an error,
59 =item git-debrebase stitch [--prose=<for commit message>]
64 If there is no ffq-prev, it is an error, unless --noop-ok.
66 It is a snag (see B<-f>) if the branch is not laundered.
68 =item git-debrebase new-upstream-v0 <new-version> [<upstream-details>...]
70 Rebases the delta queue
71 onto a new upstream version. In detail:
73 Firstly, checks that the proposed rebase seems to make sense:
74 It is a snag unless the new upstream(s)
75 are fast forward from the previous upstream(s)
76 as found in the current breakwater anchor.
77 And, in the case of a multi-piece upstream
78 (a multi-component upstream, in dpkg-source terminology),
79 if the pieces are not in the same order, with the same names.
81 If all seems well, unstitches and launders the branch.
85 (in a private working area)
86 a new anchor merge commit,
87 on top of the breakwater tip,
88 and on top of that a commit to
89 update the version number in debian/changelog.
93 of the delta queue onto these new commits.
95 That git-rebase may complete successfully,
96 or it may require your assistance,
97 just like a normal git-rebase.
99 If you git-rebase --abort,
100 the whole new upstream operation is aborted,
101 except for the laundering.
103 The <upstream-details> are, optionally, in order:
107 =item <upstream-commit-ish>
109 The new upstream branch (or commit-ish).
110 Default is C<upstream>.
112 It is a snag if the upstream contains a debian/ directory;
113 if forced to proceed,
114 git-debrebase will disregard the upstream's debian/ and
115 take (only) the packaging from the current breakwater.
117 =item <piece-name> <piece-upstream-commit-ish>
119 Specifies that this is a multi-piece upstream.
122 When such a pair is specified,
123 git-debrebase will first combine the pieces of the upstream
125 and then use the result as the combined new upstream.
127 For each <piece-name>,
128 the tree of the <piece-upstream-commit-ish>
129 becomes the subdirectory <piece-name>
130 in the combined new upstream
131 (supplanting any subdirectory that might be there in
132 the main upstream branch).
134 <piece-name> has a restricted syntax:
135 it may contain only ASCII alphanumerics and hyphens.
137 The combined upstream is itself recorded as a commit,
138 with each of the upstream pieces' commits as parents.
139 The combined commit contains an annotation
140 to allow a future git-debrebase new upstream operation
141 to make the coherency checks described above.
143 =item <git-rebase options>
145 These will be passed to git rebase.
147 If the upstream rebase is troublesome, -i may be helpful.
148 As with plain git-debrebase,
149 do not specify a base, or --onto, or --fork-point.
153 If you are planning to generate a .dsc,
154 you will also need to have, or generate,
155 actual orig tarball(s),
156 which must be identical to the rev-spec(s)
157 passed to git-debrebase.
158 git-debrebase does not concern itself with source packages
159 so neither helps with this, nor checks it.
161 L<git-archive(1)>, L<dgit(1)> and
162 L<gbp-import-orig(1)> may be able to help.
164 This subcommand has -v0 in its name because we are not yet sure
165 that its command line syntax is optimal.
166 We may want to introduce an incompatible replacement syntax
167 under the name C<new-upstream>.
169 =item git-debrebase convert-from-gbp [<upstream-commit-ish>]
171 Cnnverts a gbp patches-unapplied branch
172 (not a gbp pq patch queue branch)
173 into a git-debrebase interchange branch.
175 This is done by generating a new anchor merge,
176 converting the quilt patches as a delta queue,
177 and dropping the patches from the tree.
179 The upstream commit-ish should correspond to
180 the gbp upstream branch, if there is one.
181 It is a snag if it is not an ancestor of HEAD,
182 or if the history between the upstream and HEAD
183 contains commits which make changes to upstream files.
185 It is also a snag if the specified upstream
186 has a debian/ subdirectory.
187 This check exists to detect certain likely user errors,
188 but if this situation is true and expected,
191 The result is a well-formed git-debrebase interchange branch.
192 The result is also fast-forward from the gbp branch.
194 Note that it is dangerous not to know whether you are
195 dealing with a gbp patches-unappled branch containing quilt patches,
196 or a git-debrebase interchange branch.
198 using the wrong tool for the branch format might result in
199 a dropped patch queue!
203 =head1 UNDERLYING AND SUPPLEMENTARY OPERATIONS
207 =item git-debrebase breakwater
209 Prints the breakwater tip commitid.
210 If your HEAD branch is not fully laundered,
211 prints the tip of the so-far-laundered breakwater.
213 =item git-debrebase anchor
215 Prints the breakwater anchor commitid.
217 =item git-debrebase analyse
219 Walks the history of the current branch,
220 most recent commit first,
221 back until the most recent anchor,
222 printing the commit object id,
223 and commit type and info
224 (ie the semantics in the git-debrebase model)
227 =item git-debrebase record-ffq-prev
229 Establishes the current branch's ffq-prev,
230 as discussed in L</UNSTITCHING AND LAUNDERING>,
231 but does not launder the branch or move HEAD.
233 It is an error if the ffq-prev could not be recorded.
234 It is also an error if an ffq-prev has already been recorded,
237 =item git-debrebase launder-v0
239 Launders the branch without recording anything in ffq-prev.
240 Then prints some information about the current branch.
241 Do not use this operation;
242 it will be withdrawn soon.
244 =item git-debrebase convert-to-gbp
246 Converts a laundered branch into a
247 gbp patches-unapplied branch containing quilt patches.
248 The result is not fast forward from the interchange branch,
249 and any ffq-prev is deleted.
251 This is provided mostly for the test suite
252 and for unusual situations.
253 It should only be used with a care and
254 with a proper understanding of the underlying theory.
256 Be sure to not accidentally treat the result as
257 a git-debrebase branch,
258 or you will drop all the patches!
264 This section documents the general options
266 (ie, the ones which immediately follow
270 on the command line).
271 Individual operations may have their own options which are
272 docuented under each operation.
278 Turns snag(s) with id <snag-id> into warnings.
280 Some troublesome things which git-debrebase encounters
282 (The specific instances are discussed
283 in the text for the relvant operation.)
285 When a snag is detected,
286 a message is printed to stderr containing the snag id
287 (in the form C<-f<snag-idE<gt>>),
288 along with some prose.
290 If snags are detected, git-debrebase does not continue,
291 unless the relevant -f<snag-id> is specified,
292 or --force is specified.
296 Turns all snags into warnings.
297 See the -f<snag-id> option.
299 Do not invoke git-debrebase --force in scripts and aliases;
300 instead, specify the particular -f<snag-id> for expected snags.
304 Suppresses the error in
305 some situations where git-debrebase does nothing,
306 because there is nothing to do.
308 The specific instances are discussed
309 in the text for the relvant operation.
311 =item --anchor=<commit-ish>
313 Treats <commit-ish> as an anchor.
314 This overrides the usual logic which automatically classifies
315 commits as anchors, pseudomerges, delta queue commits, etc.
317 It also disables some coherency checks
318 which depend on metadata extracted from its commit message,
320 it is a snag if <commit-ish> is the anchor
321 for the previous upstream version in
322 git-debrebase new-upstream operations.
326 Requests (more) debugging. May be repeated.
330 =head1 UNSTITCHING AND LAUNDERING
332 Several operations unstitch and launder the branch first.
333 In detail this means:
335 =head2 Establish the current branch's ffq-prev
337 If ffq-prev is not yet recorded,
338 git-debrebase checks that the current branch is ahead of relevant
339 remote tracking branches.
340 The relevant branches depend on
341 the current branch (and its
349 The branch that git would merge from
350 (remote.<branch>.merge, remote.<branch>.remote);
354 The branch git would push to, if different
355 (remote.<branch>.pushRemote etc.);
359 For local dgit suite branches,
360 the corresponding tracking remote;
364 If you are on C<master>,
365 remotes/dgit/dgit/sid.
369 The apparently relevant ref names to check are filtered through
370 branch.<branch>.ffq-ffrefs,
371 which is a semicolon-separated list of glob patterns,
372 each optionally preceded by !; first match wins.
374 In each case it is a snag if
375 the local HEAD is behind the checked remote,
376 or if local HEAD has diverged from it.
377 All the checks are done locally using the remote tracking refs:
378 git-debrebase does not fetch anything from anywhere.
380 If these checks pass,
382 git-debrebse then records the current tip as ffq-prev.
384 =head2 Examine the branch
387 analyses the current HEAD's history to find the anchor
389 and the most recent breakwater tip.
391 =head2 Rewrite the commits into laundered form
393 Mixed debian+upstream commits are split into two commits each.
394 Delta queue (upstream files) commits bubble to the top.
396 and quilt patch additions,
399 This rewrite will always succeed, by construction.
400 The result is the laundered branch.
405 dgit-maint-rebase(7),