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(7)>.
19 For background, theory of operation,
20 and definitions see L<git-debrebase(5)>.
22 You should read this manpage in cojnunction 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 status
60 Analyses the current branch,
61 both in terms of its contents,
62 and the refs which are relevant to git-debrebase,
63 and prints a human-readable summary.
65 Please do not attempt to parse the output;
66 it may be reformatted or reorganised in the future.
68 use one of the L<UNDERLYING AND SUPPLEMENTARY OPERATIONS>
71 =item git-debrebase conclude
73 Finishes a git-debrebase session,
74 tidying up the branch and making it fast forward again.
76 Specifically: if the branch is unstitched,
77 launders and restitches it,
78 making a new pseudomerge.
79 Otherwise, it is an error,
82 =item git-debrebase quick
84 Unconditionally launders and restitches the branch,
85 consuming any ffq-prev
86 and making a new pseudomerge.
88 If the branch is already laundered and stitched, does nothing.
90 =item git-debrebase prepush [--prose=<for commit message>]
92 =item git-debrebase stitch [--prose=<for commit message>]
96 This is a good command to run before pushing to a git server.
98 If there is no ffq-prev, it is an error, unless --noop-ok.
100 You should consider using B<conclude> instead,
101 because that launders the branch too.
103 =item git-debrebase new-upstream <new-version> [<upstream-details>...]
105 Rebases the delta queue
106 onto a new upstream version. In detail:
108 Firstly, checks that the proposed rebase seems to make sense:
109 It is a snag unless the new upstream(s)
110 are fast forward from the previous upstream(s)
111 as found in the current breakwater anchor.
112 And, in the case of a multi-piece upstream
113 (a multi-component upstream, in dpkg-source terminology),
114 if the pieces are not in the same order, with the same names.
116 If all seems well, unstitches and launders the branch.
120 (in a private working area)
121 a new anchor merge commit,
122 on top of the breakwater tip,
123 and on top of that a commit to
124 update the version number in debian/changelog.
128 of the delta queue onto these new commits.
130 That git-rebase may complete successfully,
131 or it may require your assistance,
132 just like a normal git-rebase.
134 If you git-rebase --abort,
135 the whole new upstream operation is aborted,
136 except for the laundering.
139 may be whole new Debian version, including revision,
140 or just the upstream part,
141 in which case -1 will be appended
142 to make the new Debian version.
144 The <upstream-details> are, optionally, in order:
148 =item <upstream-commit-ish>
150 The new upstream branch (or commit-ish).
151 The default is to look for one of these tags, in this order:
153 where U is the new upstream version.
154 (This is the same algorithm as L<git-deborig(1)>.)
156 It is a snag if the upstream contains a debian/ directory;
157 if forced to proceed,
158 git-debrebase will disregard the upstream's debian/ and
159 take (only) the packaging from the current breakwater.
161 =item <piece-name> <piece-upstream-commit-ish>
163 Specifies that this is a multi-piece upstream.
166 When such a pair is specified,
167 git-debrebase will first combine the pieces of the upstream
169 and then use the result as the combined new upstream.
171 For each <piece-name>,
172 the tree of the <piece-upstream-commit-ish>
173 becomes the subdirectory <piece-name>
174 in the combined new upstream
175 (supplanting any subdirectory that might be there in
176 the main upstream branch).
178 <piece-name> has a restricted syntax:
179 it may contain only ASCII alphanumerics and hyphens.
181 The combined upstream is itself recorded as a commit,
182 with each of the upstream pieces' commits as parents.
183 The combined commit contains an annotation
184 to allow a future git-debrebase new upstream operation
185 to make the coherency checks described above.
187 =item <git-rebase options>
189 These will be passed to git rebase.
191 If the upstream rebase is troublesome, -i may be helpful.
192 As with plain git-debrebase,
193 do not specify a base, or --onto, or --fork-point.
197 If you are planning to generate a .dsc,
198 you will also need to have, or generate,
199 actual orig tarball(s),
200 which must be identical to the rev-spec(s)
201 passed to git-debrebase.
202 git-debrebase does not concern itself with source packages
203 so neither helps with this, nor checks it.
205 L<git-archive(1)>, L<dgit(1)> and
206 L<gbp-import-orig(1)> may be able to help.
208 =item git-debrebase make-patches [--quiet-would-amend]
210 Generate patches in debian/patches/
211 representing the changes made to upstream files.
213 It is not normally necessary to run this command explicitly.
214 When uploading to Debian,
215 dgit and git-debrebase
216 will cooperate to regenerate patches as necessary.
217 When working with pure git remotes,
218 the patches are not needed.
220 Normally git-debrebase make-patches will
221 require a laundered branch.
222 (A laundered branch does not contain any patches.)
223 But if there are already some patches made by
224 git-debrebase make-patches,
225 and all that has happened is that more
226 changes to upstream files have been committed,
227 running it again can add the missing patches.
229 If the patches implied by the current branch
230 are not a simple superset of those already in debian/patches,
231 make-patches will fail with exit status 7,
232 and an error message.
233 (The message can be suppress with --quiet-would-amend.)
234 If the problem is simply that
235 the existing patches were not made by git-debrebase,
236 using dgit quilt-fixup instead should succeed.
238 =item git-debrebase convert-from-gbp [<upstream-commit-ish>]
240 Cnnverts a gbp patches-unapplied branch
241 (not a gbp pq patch queue branch)
242 into a git-debrebase interchange branch.
244 This is done by generating a new anchor merge,
245 converting the quilt patches as a delta queue,
246 and dropping the patches from the tree.
248 The upstream commit-ish should correspond to
249 the gbp upstream branch, if there is one.
250 It is a snag if it is not an ancestor of HEAD,
251 or if the history between the upstream and HEAD
252 contains commits which make changes to upstream files.
253 If it is not specified,
254 the same algorithm is used as for git-debrebase new-upstream.
256 It is also a snag if the specified upstream
257 has a debian/ subdirectory.
258 This check exists to detect certain likely user errors,
259 but if this situation is true and expected,
262 git-debrebase will try to look for the dgit archive view
263 of the most recent release,
264 and if it finds it will make a pseduomerge so that
265 your new git-debrebase view is appropriately fast forward.
267 The result is a well-formed git-debrebase interchange branch.
268 The result is also fast-forward from the gbp branch.
270 It is a snag if the new branch looks like it will have diverged,
271 just as for a laundering/unstitching call to git-debrebase;
272 See L</Establish the current branch's ffq-prev>, below.
274 Note that it is dangerous not to know whether you are
275 dealing with a gbp patches-unappled branch containing quilt patches,
276 or a git-debrebase interchange branch.
278 using the wrong tool for the branch format might result in
279 a dropped patch queue!
283 =head1 UNDERLYING AND SUPPLEMENTARY OPERATIONS
287 =item git-debrebase breakwater
289 Prints the breakwater tip commitid.
290 If your HEAD branch is not fully laundered,
291 prints the tip of the so-far-laundered breakwater.
293 =item git-debrebase anchor
295 Prints the breakwater anchor commitid.
297 =item git-debrebase analyse
299 Walks the history of the current branch,
300 most recent commit first,
301 back until the most recent anchor,
302 printing the commit object id,
303 and commit type and info
304 (ie the semantics in the git-debrebase model)
307 =item git-debrebase record-ffq-prev
309 Establishes the current branch's ffq-prev,
310 as discussed in L</UNSTITCHING AND LAUNDERING>,
311 but does not launder the branch or move HEAD.
313 It is an error if the ffq-prev could not be recorded.
314 It is also an error if an ffq-prev has already been recorded,
317 =item git-debrebase launder-v0
319 Launders the branch without recording anything in ffq-prev.
320 Then prints some information about the current branch.
321 Do not use this operation;
322 it will be withdrawn soon.
324 =item git-debrebase convert-to-gbp
326 Converts a laundered branch into a
327 gbp patches-unapplied branch containing quilt patches.
328 The result is not fast forward from the interchange branch,
329 and any ffq-prev is deleted.
331 This is provided mostly for the test suite
332 and for unusual situations.
333 It should only be used with a care and
334 with a proper understanding of the underlying theory.
336 Be sure to not accidentally treat the result as
337 a git-debrebase branch,
338 or you will drop all the patches!
344 This section documents the general options
346 (ie, the ones which immediately follow
350 on the command line).
351 Individual operations may have their own options which are
352 docuented under each operation.
358 Turns snag(s) with id <snag-id> into warnings.
360 Some troublesome things which git-debrebase encounters
362 (The specific instances are discussed
363 in the text for the relevant operation.)
365 When a snag is detected,
366 a message is printed to stderr containing the snag id
367 (in the form C<-f<snag-idE<gt>>),
368 along with some prose.
370 If snags are detected, git-debrebase does not continue,
371 unless the relevant -f<snag-id> is specified,
372 or --force is specified.
376 Turns all snags into warnings.
377 See the -f<snag-id> option.
379 Do not invoke git-debrebase --force in scripts and aliases;
380 instead, specify the particular -f<snag-id> for expected snags.
384 Suppresses the error in
385 some situations where git-debrebase does nothing,
386 because there is nothing to do.
388 The specific instances are discussed
389 in the text for the relvant operation.
391 =item --anchor=<commit-ish>
393 Treats <commit-ish> as an anchor.
394 This overrides the usual logic which automatically classifies
395 commits as anchors, pseudomerges, delta queue commits, etc.
397 It also disables some coherency checks
398 which depend on metadata extracted from its commit message,
400 it is a snag if <commit-ish> is the anchor
401 for the previous upstream version in
402 git-debrebase new-upstream operations.
406 Requests (more) debugging. May be repeated.
410 =head1 UNSTITCHING AND LAUNDERING
412 Several operations unstitch and launder the branch first.
413 In detail this means:
415 =head2 Establish the current branch's ffq-prev
417 If ffq-prev is not yet recorded,
418 git-debrebase checks that the current branch is ahead of relevant
419 remote tracking branches.
420 The relevant branches depend on
421 the current branch (and its
429 The branch that git would merge from
430 (remote.<branch>.merge, remote.<branch>.remote);
434 The branch git would push to, if different
435 (remote.<branch>.pushRemote etc.);
439 For local dgit suite branches,
440 the corresponding tracking remote;
444 If you are on C<master>,
445 remotes/dgit/dgit/sid.
449 The apparently relevant ref names to check are filtered through
450 branch.<branch>.ffq-ffrefs,
451 which is a semicolon-separated list of glob patterns,
452 each optionally preceded by !; first match wins.
454 In each case it is a snag if
455 the local HEAD is behind the checked remote,
456 or if local HEAD has diverged from it.
457 All the checks are done locally using the remote tracking refs:
458 git-debrebase does not fetch anything from anywhere.
460 If these checks pass,
462 git-debrebse then records the current tip as ffq-prev.
464 =head2 Examine the branch
467 analyses the current HEAD's history to find the anchor
469 and the most recent breakwater tip.
471 =head2 Rewrite the commits into laundered form
473 Mixed debian+upstream commits are split into two commits each.
474 Delta queue (upstream files) commits bubble to the top.
476 and quilt patch additions,
479 This rewrite will always succeed, by construction.
480 The result is the laundered branch.
485 dgit-maint-rebase(7),