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 quick
60 Unconditionally launders and restitches the branch,
61 consuming any ffq-prev
62 and making a new pseudomerge.
64 If the branch is already laundered and stitched, it is an error,
67 =item git-debrebase stitch [--prose=<for commit message>]
72 If there is no ffq-prev, it is an error, unless --noop-ok.
74 It is a snag (see B<-f>) if the branch is not laundered.
76 =item git-debrebase new-upstream-v0 <new-version> [<upstream-details>...]
78 Rebases the delta queue
79 onto a new upstream version. In detail:
81 Firstly, checks that the proposed rebase seems to make sense:
82 It is a snag unless the new upstream(s)
83 are fast forward from the previous upstream(s)
84 as found in the current breakwater anchor.
85 And, in the case of a multi-piece upstream
86 (a multi-component upstream, in dpkg-source terminology),
87 if the pieces are not in the same order, with the same names.
89 If all seems well, unstitches and launders the branch.
93 (in a private working area)
94 a new anchor merge commit,
95 on top of the breakwater tip,
96 and on top of that a commit to
97 update the version number in debian/changelog.
101 of the delta queue onto these new commits.
103 That git-rebase may complete successfully,
104 or it may require your assistance,
105 just like a normal git-rebase.
107 If you git-rebase --abort,
108 the whole new upstream operation is aborted,
109 except for the laundering.
111 The <upstream-details> are, optionally, in order:
115 =item <upstream-commit-ish>
117 The new upstream branch (or commit-ish).
118 Default is C<upstream>.
120 It is a snag if the upstream contains a debian/ directory;
121 if forced to proceed,
122 git-debrebase will disregard the upstream's debian/ and
123 take (only) the packaging from the current breakwater.
125 =item <piece-name> <piece-upstream-commit-ish>
127 Specifies that this is a multi-piece upstream.
130 When such a pair is specified,
131 git-debrebase will first combine the pieces of the upstream
133 and then use the result as the combined new upstream.
135 For each <piece-name>,
136 the tree of the <piece-upstream-commit-ish>
137 becomes the subdirectory <piece-name>
138 in the combined new upstream
139 (supplanting any subdirectory that might be there in
140 the main upstream branch).
142 <piece-name> has a restricted syntax:
143 it may contain only ASCII alphanumerics and hyphens.
145 The combined upstream is itself recorded as a commit,
146 with each of the upstream pieces' commits as parents.
147 The combined commit contains an annotation
148 to allow a future git-debrebase new upstream operation
149 to make the coherency checks described above.
151 =item <git-rebase options>
153 These will be passed to git rebase.
155 If the upstream rebase is troublesome, -i may be helpful.
156 As with plain git-debrebase,
157 do not specify a base, or --onto, or --fork-point.
161 If you are planning to generate a .dsc,
162 you will also need to have, or generate,
163 actual orig tarball(s),
164 which must be identical to the rev-spec(s)
165 passed to git-debrebase.
166 git-debrebase does not concern itself with source packages
167 so neither helps with this, nor checks it.
169 L<git-archive(1)>, L<dgit(1)> and
170 L<gbp-import-orig(1)> may be able to help.
172 This subcommand has -v0 in its name because we are not yet sure
173 that its command line syntax is optimal.
174 We may want to introduce an incompatible replacement syntax
175 under the name C<new-upstream>.
177 =item git-debrebase convert-from-gbp [<upstream-commit-ish>]
179 Cnnverts a gbp patches-unapplied branch
180 (not a gbp pq patch queue branch)
181 into a git-debrebase interchange branch.
183 This is done by generating a new anchor merge,
184 converting the quilt patches as a delta queue,
185 and dropping the patches from the tree.
187 The upstream commit-ish should correspond to
188 the gbp upstream branch, if there is one.
189 It is a snag if it is not an ancestor of HEAD,
190 or if the history between the upstream and HEAD
191 contains commits which make changes to upstream files.
193 It is also a snag if the specified upstream
194 has a debian/ subdirectory.
195 This check exists to detect certain likely user errors,
196 but if this situation is true and expected,
199 The result is a well-formed git-debrebase interchange branch.
200 The result is also fast-forward from the gbp branch.
202 Note that it is dangerous not to know whether you are
203 dealing with a gbp patches-unappled branch containing quilt patches,
204 or a git-debrebase interchange branch.
206 using the wrong tool for the branch format might result in
207 a dropped patch queue!
211 =head1 UNDERLYING AND SUPPLEMENTARY OPERATIONS
215 =item git-debrebase breakwater
217 Prints the breakwater tip commitid.
218 If your HEAD branch is not fully laundered,
219 prints the tip of the so-far-laundered breakwater.
221 =item git-debrebase anchor
223 Prints the breakwater anchor commitid.
225 =item git-debrebase analyse
227 Walks the history of the current branch,
228 most recent commit first,
229 back until the most recent anchor,
230 printing the commit object id,
231 and commit type and info
232 (ie the semantics in the git-debrebase model)
235 =item git-debrebase record-ffq-prev
237 Establishes the current branch's ffq-prev,
238 as discussed in L</UNSTITCHING AND LAUNDERING>,
239 but does not launder the branch or move HEAD.
241 It is an error if the ffq-prev could not be recorded.
242 It is also an error if an ffq-prev has already been recorded,
245 =item git-debrebase launder-v0
247 Launders the branch without recording anything in ffq-prev.
248 Then prints some information about the current branch.
249 Do not use this operation;
250 it will be withdrawn soon.
252 =item git-debrebase convert-to-gbp
254 Converts a laundered branch into a
255 gbp patches-unapplied branch containing quilt patches.
256 The result is not fast forward from the interchange branch,
257 and any ffq-prev is deleted.
259 This is provided mostly for the test suite
260 and for unusual situations.
261 It should only be used with a care and
262 with a proper understanding of the underlying theory.
264 Be sure to not accidentally treat the result as
265 a git-debrebase branch,
266 or you will drop all the patches!
272 This section documents the general options
274 (ie, the ones which immediately follow
278 on the command line).
279 Individual operations may have their own options which are
280 docuented under each operation.
286 Turns snag(s) with id <snag-id> into warnings.
288 Some troublesome things which git-debrebase encounters
290 (The specific instances are discussed
291 in the text for the relvant operation.)
293 When a snag is detected,
294 a message is printed to stderr containing the snag id
295 (in the form C<-f<snag-idE<gt>>),
296 along with some prose.
298 If snags are detected, git-debrebase does not continue,
299 unless the relevant -f<snag-id> is specified,
300 or --force is specified.
304 Turns all snags into warnings.
305 See the -f<snag-id> option.
307 Do not invoke git-debrebase --force in scripts and aliases;
308 instead, specify the particular -f<snag-id> for expected snags.
312 Suppresses the error in
313 some situations where git-debrebase does nothing,
314 because there is nothing to do.
316 The specific instances are discussed
317 in the text for the relvant operation.
319 =item --anchor=<commit-ish>
321 Treats <commit-ish> as an anchor.
322 This overrides the usual logic which automatically classifies
323 commits as anchors, pseudomerges, delta queue commits, etc.
325 It also disables some coherency checks
326 which depend on metadata extracted from its commit message,
328 it is a snag if <commit-ish> is the anchor
329 for the previous upstream version in
330 git-debrebase new-upstream operations.
334 Requests (more) debugging. May be repeated.
338 =head1 UNSTITCHING AND LAUNDERING
340 Several operations unstitch and launder the branch first.
341 In detail this means:
343 =head2 Establish the current branch's ffq-prev
345 If ffq-prev is not yet recorded,
346 git-debrebase checks that the current branch is ahead of relevant
347 remote tracking branches.
348 The relevant branches depend on
349 the current branch (and its
357 The branch that git would merge from
358 (remote.<branch>.merge, remote.<branch>.remote);
362 The branch git would push to, if different
363 (remote.<branch>.pushRemote etc.);
367 For local dgit suite branches,
368 the corresponding tracking remote;
372 If you are on C<master>,
373 remotes/dgit/dgit/sid.
377 The apparently relevant ref names to check are filtered through
378 branch.<branch>.ffq-ffrefs,
379 which is a semicolon-separated list of glob patterns,
380 each optionally preceded by !; first match wins.
382 In each case it is a snag if
383 the local HEAD is behind the checked remote,
384 or if local HEAD has diverged from it.
385 All the checks are done locally using the remote tracking refs:
386 git-debrebase does not fetch anything from anywhere.
388 If these checks pass,
390 git-debrebse then records the current tip as ffq-prev.
392 =head2 Examine the branch
395 analyses the current HEAD's history to find the anchor
397 and the most recent breakwater tip.
399 =head2 Rewrite the commits into laundered form
401 Mixed debian+upstream commits are split into two commits each.
402 Delta queue (upstream files) commits bubble to the top.
404 and quilt patch additions,
407 This rewrite will always succeed, by construction.
408 The result is the laundered branch.
413 dgit-maint-rebase(7),