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 stitch [--prose=<for commit message>]
56 If there is no ffq-prev, it is an error, unless --noop-ok.
58 It is a problem if the branch is not laundered.
60 =item git-debrebase new-upstream-v0 <new-version> [<upstream-details>...]
62 Rebases the delta queue
63 onto a new upstream version. In detail:
65 Firstly, checks that the proposed rebase seems to make sense:
66 It is a problem unless the new upstream(s)
67 are fast forward from the previous upstream(s)
68 as found in the current breakwater anchor.
69 And, in the case of a multi-piece upstream
70 (a multi-component upstream, in dpkg-source terminology),
71 if the pieces are not in the same order, with the same names.
73 If all seems well, unstitches and launders the branch.
77 (in a private working area)
78 a new anchor merge commit,
79 on top of the breakwater tip,
80 and on top of that a commit to
81 update the version number in debian/changelog.
85 of the delta queue onto these new commits.
87 That git-rebase may complete successfully,
88 or it may require your assistance,
89 just like a normal git-rebase.
91 If you git-rebase --abort,
92 the whole new upstream operation is aborted,
93 except for the laundering.
95 The <upstream-details> are, optionally, in order:
99 =item <upstream-commit-ish>
101 The new upstream branch (or commit-ish).
102 Default is C<upstream>.
104 It is a problem if the upstream contains a debian/ directory;
105 if forced to proceed,
106 git-debrebase will disregard the upstream's debian/ and
107 take (only) the packaging from the current breakwater.
109 =item <piece-name> <piece-upstream-commit-ish>
111 Specifies that this is a multi-piece upstream.
114 When such a pair is specified,
115 git-debrebase will first combine the pieces of the upstream
117 and then use the result as the combined new upstream.
119 For each <piece-name>,
120 the tree of the <piece-upstream-commit-ish>
121 becomes the subdirectory <piece-name>
122 in the combined new upstream
123 (supplanting any subdirectory that might be there in
124 the main upstream branch).
126 <piece-name> has a restricted syntax:
127 it may contain only ASCII alphanumerics and hyphens.
129 The combined upstream is itself recorded as a commit,
130 with each of the upstream pieces' commits as parents.
131 The combined commit contains an annotation
132 to allow a future git-debrebase new upstream operation
133 to make the coherency checks described above.
135 =item <git-rebase options>
137 These will be passed to git rebase.
139 If the upstream rebase is troublesome, -i may be helpful.
140 As with plain git-debrebase,
141 do not specify a base, or --onto, or --fork-point.
145 If you are planning to generate a .dsc,
146 you will also need to have, or generate,
147 actual orig tarball(s),
148 which must be identical to the rev-spec(s)
149 passed to git-debrebase.
150 git-debrebase does not concern itself with source packages
151 so neither helps with this, nor checks it.
153 L<git-archive(1)>, L<dgit(1)> and
154 L<gbp-import-orig(1)> may be able to help.
156 This subcommand has -v0 in its name because we are not yet sure
157 that its command line syntax is optimal.
158 We may want to introduce an incompatible replacement syntax
159 under the name C<new-upstream>.
161 =item git-debrebase convert-from-gbp [<upstream-commit-ish>]
163 Cnnverts a gbp patches-unapplied branch
164 (not a gbp pq patch queue branch)
165 into a git-debrebase interchange branch.
167 This is done by generating a new anchor merge,
168 converting the quilt patches as a delta queue,
169 and dropping the patches from the tree.
171 The upstream commit-ish should correspond to
172 the gbp upstream branch, if there is one.
173 It is a problem if it is not an ancestor of HEAD,
174 or if the history between the upstream and HEAD
175 contains commits which make changes to upstream files.
177 It is also a problem if the specified upstream
178 has a debian/ subdirectory.
179 This check exists to detect certain likely user errors,
180 but if this situation is true and expected,
183 The result is a well-formed git-debrebase interchange branch.
184 The result is also fast-forward from the gbp branch.
186 Note that it is dangerous not to know whether you are
187 dealing with a gbp patches-unappled branch containing quilt patches,
188 or a git-debrebase interchange branch.
190 using the wrong tool for the branch format might result in
191 a dropped patch queue!
195 =head1 UNDERLYING AND SUPPLEMENTARY OPERATIONS
199 =item git-debrebase breakwater
201 Prints the breakwater tip commitid.
202 If your HEAD branch is not fully laundered,
203 prints the tip of the so-far-laundered breakwater.
205 =item git-debrebase anchor
207 Prints the breakwater anchor commitid.
209 =item git-debrebase analyse
211 Walks the history of the current branch,
212 most recent commit first,
213 back until the most recent anchor,
214 printing the commit object id,
215 and commit type and info
216 (ie the semantics in the git-debrebase model)
219 =item git-debrebase record-ffq-prev
221 Establishes the current branch's ffq-prev,
222 as discussed in L</UNSTITCHING AND LAUNDERING>,
223 but does not launder the branch or move HEAD.
225 It is an error if the ffq-prev could not be recorded.
226 It is also an error if an ffq-prev has already been recorded,
229 =item git-debrebase launder-v0
231 Launders the branch without recording anything in ffq-prev.
232 Then prints some information about the current branch.
233 Do not use this operation;
234 it will be withdrawn soon.
236 =item git-debrebase convert-to-gbp
238 Converts a laundered branch into a
239 gbp patches-unapplied branch containing quilt patches.
240 The result is not fast forward from the interchange branch,
241 and any ffq-prev is deleted.
243 This is provided mostly for the test suite
244 and for unusual situations.
245 It should only be used with a care and
246 with a proper understanding of the underlying theory.
248 Be sure to not accidentally treat the result as
249 a git-debrebase branch,
250 or you will drop all the patches!
256 This section documents the general options
258 (ie, the ones which immediately follow
262 on the command line).
263 Individual operations may have their own options which are
264 docuented under each operation.
270 Turns problems with id <problem-id> into warnings.
272 Some troublesome things which git-debrebase encounters
274 (The specific instances are discussed
275 in the text for the relvant operation.)
277 When a problem is detected,
278 a message is printed to stderr containing the problem id
279 (in the form C<-f<problem-idE<gt>>),
280 along with some prose.
282 If problems are detected, git-debrebase does not continue,
283 unless the relevant -f<problem-id> is specified,
284 or --force is specified.
288 Turns all problems into warnings.
289 See the -f<problem-id> option.
291 Do not invoke git-debrebase --force in scripts and aliases;
292 instead, specify the particular -f<problem-id> for expected problems.
296 Suppresses the error in
297 some situations where git-debrebase does nothing,
298 because there is nothing to do.
300 The specific instances are discussed
301 in the text for the relvant operation.
303 =item --anchor=<commit-ish>
305 Treats <commit-ish> as an anchor.
306 This overrides the usual logic which automatically classifies
307 commits as anchors, pseudomerges, delta queue commits, etc.
309 It also disables some coherency checks
310 which depend on metadata extracted from its commit message,
312 it is a problem if <commit-ish> is the anchor
313 for the previous upstream version in
314 git-debrebase new-upstream operations.
318 Requests (more) debugging. May be repeated.
322 =head1 UNSTITCHING AND LAUNDERING
324 Several operations unstitch and launder the branch first.
325 In detail this means:
327 =head2 Establish the current branch's ffq-prev
329 If ffq-prev is not yet recorded,
330 git-debrebase checks that the current branch is ahead of relevant
331 remote tracking branches.
332 The relevant branches depend on
333 the current branch (and its
341 The branch that git would merge from
342 (remote.<branch>.merge, remote.<branch>.remote);
346 The branch git would push to, if different
347 (remote.<branch>.pushRemote etc.);
351 For local dgit suite branches,
352 the corresponding tracking remote;
356 If you are on C<master>,
357 remotes/dgit/dgit/sid.
361 The apparently relevant ref names to check are filtered through
362 branch.<branch>.ffq-ffrefs,
363 which is a semicolon-separated list of glob patterns,
364 each optionally preceded by !; first match wins.
366 In each case it is a problem if
367 the local HEAD is behind the checked remote,
368 or if local HEAD has diverged from it.
369 All the checks are done locally using the remote tracking refs:
370 git-debrebase does not fetch anything from anywhere.
372 If these checks pass,
374 git-debrebse then records the current tip as ffq-prev.
376 =head2 Examine the branch
379 analyses the current HEAD's history to find the anchor
381 and the most recent breakwater tip.
383 =head2 Rewrite the commits into laundered form
385 Mixed debian+upstream commits are split into two commits each.
386 Delta queue (upstream files) commits bubble to the top.
388 and quilt patch additions,
391 This rewrite will always succeed, by construction.
392 The result is the laundered branch.
397 dgit-maint-rebase(7),