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 of the terms used here,
21 see L<git-debrebase(5)>.
23 If no operation is specified,
24 git-debrebase launders the branch and rebases the Debian delta queue.
27 =head1 PRINCIPAL OPERATIONS
31 =item git-debrebase [-- <git-rebase options...>]
33 Unstitches and launders the branch.
34 (See L</UNSTITCHING AND LAUNDERING> below.)
36 Then optionally edits the Debian delta queue,
37 using git-rebase, by running
39 git rebase <git-rebase options> <breakwater-tip>
41 Do not pass a base branch argument:
42 git-debrebase will supply that.
43 Do not use --onto, or --fork-point.
44 Useful git-rebase options include -i and --autosquash.
46 If git-rebase stops for any reason,
47 you may git-rebase --abort, --continue, or --skip, as usual.
48 If you abort the git-rebase,
49 the branch will still have been laundered,
50 but everything in the rebase will be undone.
52 =item git-debrebase stitch [--prose=<for commit message>]
57 If there is no ffq-prev, it is an error, unless --noop-ok.
59 =item git-debrebase new-upstream-v0 <new-version> [<upstream-details>...]
61 Rebases the delta queue
62 onto a new upstream version. In detail:
64 Firstly, checks that the proposed rebase seems to make sense:
65 It is a problem unless the new upstream(s)
66 are fast forward from the previous upstream(s)
67 as found in the current breakwater anchor.
68 And, in the case of a multi-piece upstream,
69 if the pieces are not in the same order, with the same names.
71 If all seems well, unstitches and launders the branch.
75 (in a private working area)
76 a new anchor merge commit,
77 on top of the breakwater tip,
78 and on top of that a commit to
79 update the version number in debian/changelog.
83 of the delta queue onto these new commits.
85 That git-rebase may complete successfully,
86 or it may require your assistance,
87 just like a normal git-rebase.
89 If you git-rebase --abort,
90 the whole new upstream operation is aborted,
91 but the laundering will still have been done.
93 The <upstream-details> are, optionally, in order:
97 =item <upstream-commitish>
99 The new upstream branch (or commitish).
100 Default is C<upstream>.
102 It is a problem if the upstream contains a debian/ directory;
103 if forced to proceed,
104 git-debrebase will disregard the upstream's debian/ and
105 take (only) the packaging from the current breakwater.
107 =item <piece-name> <piece-upstream-commitish>
109 Specifies that this is a multi-piece upstream.
110 (A multi-component upstream, in dpkg-source terminology.)
113 When such a pair is specified,
114 git-debrebase will first combine the pieces of the upstream
116 and then use the result as the combined new upstream.
118 For each <piece-name>,
119 the tree of the <piece-upstream-commitish>
120 becomes the subdirectory <piece-name>
121 in the combined new upstream
122 (supplanting any subdirectory that might be there in
123 the main upstream branch).
125 <piece-name> has a restricted syntax:
126 it may contain only ASCII alphanumerics and hyphens.
128 The combined upstream is itself recorded as a commit,
129 with each of the upstream pieces' commits as parents.
130 The combined commit contains an annotation
131 to allow a future git-debrebase new upstream operation
132 to make the coherency checks described above.
134 =item <git-rebase options>
136 These will be passed to git rebase.
138 If the upstream rebase is troublesome, -i may be helpful.
139 As with plain git-debrebase,
140 do not specify a base, or --onto, or --fork-point.
144 If you are planning to generate a .dsc,
145 you will also need to have, or generate,
146 actual orig tarball(s),
147 which must be identical to the rev-spec(s)
148 passed to git-debrebase.
149 git-debrebase does not concern itself with source packages
150 so neither helps with this, nor checks it.
151 L<git-archive(1)>, L<dgit(1)> and L<gbp(1)> may be able to help.
153 This subcommand has -v0 in its name because we are not yet sure
154 that its command line syntax is optimal.
155 We may want to introduce an incompatible replacement syntax
156 under the name C<new-upstream>.
160 =head1 UNDERLYING AND SUPPLEMENTARY OPERATIONS
164 =item git-debrebase breakwater
166 Prints the breakwater tip commitid.
167 Fails if your HEAD branch is not laundered.
171 =head1 UNSTITCHING AND LAUNDERING
173 Several operations unstitch and launder the branch first.
174 In detail this means:
176 =head2 Establish the current branch's ffq-prev
178 If it is not yet recorded,
179 git-debrebase checks that the current branch is ahead of relevant
180 remote tracking branches.
182 The remote tracking branches checked by default are
183 obtained from the git config.
184 In each case it is a problem if
185 the local HEAD is behind the checked remote,
186 or if local HEAD has diverged from it.
187 All the checks are done locally using the remote tracking refs:
188 git-debrebase does not fetch anything from anywhere.
190 git-debrebase checks the branch that git would merge from
191 (remote.<branch>.merge, remote.<branch>.remote)
192 and the branch git would push to
193 (remote.<branch>.pushRemote etc.).
194 For local dgit suite branches
195 it checks the corresponding tracking remote.
196 If you are on C<master>, it checks remotes/dgit/dgit/sid.
197 The resulting ref names to check are filtered through
198 branch.<branch>.ffq-ffrefs,
199 which is a semicolon-separated list of glob patterns,
200 each optionally preceded by !; first match wins.
202 If these checks pass,
204 git-debrebse then records the current tip as ffq-prev.
206 =head2 Examine the branch
209 analyses the current HEAD's history to find the anchor
211 and the most recent breakwater tip.
213 =head2 Rewrite the commits into laundered form
215 Mixed debian+upstream commits are split into two commits each.
216 Delta queue (upstream files) commits bubble to the top.
218 and quilt patch additions,
221 This rewrite will always succeed, by construction.
222 The result is the laundered branch.
227 dgit-maint-rebase(7),