3 git-debrebase(5) data model
4 git-debrebase(1) command line
6 dgit-maint-debrebase(7)
7 someone should set branch.<name>.mergeOptions to include --ff-only ?
9 clean up remains of NOTES and README
11 arrange for dgit to automatically stitch on push
13 # git-ffqrebase start [BASE]
14 # # records previous HEAD so it can be overwritten
15 # # records base for future git-ffqrebase
16 # git-ffqrebase set-base BASE
17 # git-ffqrebase <git-rebase options>
18 # git-ffqrebase finish
19 # git-ffqrebase status [BRANCH]
21 # refs/ffq-prev/REF relates to refs/REF
23 # git-debrebase without start, if already started, is willing
24 # to strip pseudomerges provided that they overwrite exactly
26 # xxxx is this right ? what matters is have we pushed
27 # I think in fact the right answer is:
28 # git-debrebase always strips out pseudomerges from its branch
29 # a pseudomerge is put in at the time we want to push
30 # at that time, we make a pseudomerge of the remote tracking
31 # branch (if raw git) or the dgit view (if dgit)
32 # for raw git git-ffqrebase, do want preciseley to record
33 # value of remote tracking branch or our branch, on start, so we
34 # overwrite only things we intend to
35 # the previous pseudomerge check for tags and remote branches ?
42 [git-debrebase[ COMMIT-TYPE [ ARGS...]]: PROSE, MORE PROSE]
44 [git-debrebase: split mixed commit, debian part]
45 [git-debrebase: split mixed commit, upstream-part]
46 [git-debrebase: convert dgit import, debian changes]
47 [git-debrebase anchor: convert dgit import, upstream changes]
49 [git-debrebase upstream-combine . PIECE[ PIECE...]: new upstream]
50 [git-debrebase anchor: new upstream NEW-UPSTREAM-VERSION, merge]
51 [git-debrebase: new upstream NEW-UPSTREAM-VERSION, changelog]
53 [git-debrebase convert-from-gbp: drop patches]
54 [git-debrebase anchor: declare upstream]
55 [git-debrebase pseudomerge: stitch]
57 [git-debrebase convert-to-gbp: commit patches]
59 m{^\[git-debrebase (?:\w*-)?upstream combine \.((?: $extra_orig_namepart_re)+)\]}
61 Every anchor commit must be a merge. In principle, this is not
62 necessary. After all, we are relying on the
63 [git-debrebase anchor: ...]
64 commit message annotation in "declare" anchor merges (which
65 do not have any upstream changes), to distinguish those anchor
66 merges from ordinary pseudomerges (which we might just try to strip).
68 However, the user is going to be doing git-rebase a lot. We really
69 don't want them to rewrite an anchor commit. git-rebase
70 trips up on merges, so that is a useful safety catch.
77 git-debrebase blah [implies start] strips pseudomerge(s)
79 commit / git-debrebase / etc.
82 hook: call git-debrebase prep-push adds new pm ? passes --overwrite ?
83 dgit push does not update remote
85 commit / git-debrebase / etc. strips pm(s) including last one
88 hook: call git-debrebase prep-push adds new pm ? passes --overwrite ?
89 dgit push DOES update remote
91 commit / git-debrebase / etc. strips last pm, but arranges
92 that remade pm will incorporate it
96 When we strip a pm, we need to maybe record it (or something) as the
99 We do this if the pm is contained within the output branch.
101 Actually this is not special to PMs.
103 We need to record a new to-be-overwritten commit
104 merge-base( our branch tip, relevant remote )
106 If this is not a descendant of the relevant remote, then we are going
107 to have a problem when we push so issue a warning or fail.
113 git-debrebase start or git-debrebase [continue]
115 with no recorded will-overwrite
117 putative will-overwrite is
120 obviously it is safe to say we will overwrite this
121 we do not need to worry about whether this will
122 overwrite not-included changes in the remote
123 because either the will-overwrite is not
124 ff from the remote (in which case later failure,
125 see below); or the will-overwrite _is_ ff
126 from the remote ie our tip is later than the
127 remote and includes all of its changes
129 this model tends to keep ad-hoc commits made on our
130 tip branch before we did rebase start, in the
131 `interchange view' and also in the rebase stack.
134 merge-base( current remote, current tip )
136 it is safe to overwrite current tip, by the
139 it is always safe to rewind will-overwrite: all
140 that does is overwrite _less_ stuff
142 this is the earliest overwrite we can make that
143 will be pushable to the remote
145 in practical terms this can only be ff from the
146 current remote if it is equal to the current remote;
147 so what we are actually checking below is that our tip
148 is ff from the remote. This ought to be true before
149 the first of our rebases.
151 this model tends to rewind and rebase ad-hoc commits
152 made on our tip branch before we did rebase start,
155 in any case putative will-overwrite must be ff from remote.
156 Otherwise when we push it will not be ff, even though we have
157 made pseudomerge to overwrite will-overwrite. So if we spot
158 this, report an error.
160 with a recorded will-overwrite
162 we may need to advance will-overwrite, to allow us to generate
163 future pseudomerges that will be pushable
165 advancing will-overwrite is dangerous, since it might
166 effectively cancel the commits that will-ovewrite is advanced
169 we advance it to merge-base( current remote, current tip )
170 if possible (see above), - ie to current remote, subject
171 to the condition that that is an ancestor of current tip
173 In each case we can strip pseudomerges freely, as needed. We do not
174 want to record what pseudomerges we strip, because whether we need to
175 keep them depends (only) on whether they have been pushed.
177 Is that actually true ? What if the user actually _wanted_ to keep
178 the pseudomerge despite not having pushed it ?
180 In that case we need to advance will-overwrite past it. We could
181 provide an explicit command to do this: it would advance
182 will-overwrite to the current tip (see rules above, which show that
183 this is OK). Or maybe to the last pseudomerge on the current tip,
184 so that the overall result will be series of pseudomerges.
186 ========================================
188 So, pm handling specifics:
190 strategy is to avoid making needless pseudomerges
191 pseudomerges that exist will be preserved
192 (by being included in will-overwrite)
194 This is good because the presence of a pseudomerge means we know we
195 want to keep it; and that allows explicit control over history detail
198 It does mean we must avoid making the pseudomerges unnecessarily.
199 They should be made just before (ideally, part of) dgit push.
201 1. git-debrebase [-i etc.]
204 check for will-overwrite
205 if is already a will-overwrite, fine, do no more
208 check our origin branch exists and we are ff from it
211 check our other might-be-pushed to branches
212 check we are ff from them
215 set will-overwrite to something which is ff from
218 we use our tip, as discussed above
219 (optionally, can use some other commit which is ff
220 from all of the above, eg one of them)
222 N. git-debrebase [--noop-ok] record-ffq-prev
224 does what is described above
226 2. git-debrebase [--noop-ok] stitch
228 makes pseudomerge with will-overwrite
229 deletes will-overwrite
231 we will teach dgit to do
234 3. git-debrebase push
236 like git push only does stitch first
237 ??? command line parsing!
239 4. git-debrebase release
241 stiches, finalises changelog, signs tags, pushes everything
242 for the future, when there is some automatic builder
244 will-overwrite for each ref
249 ========================================
253 [ all this is done now:
255 current HEAD (patches-unapplied),
256 this is going to be the base of the old breakwater
260 HEAD:<upstream> = upstream:<upstream>
261 upstream..HEAD:<upstream> is empty (overrideable)
262 upstremm:debian is empty (overrideable)
266 run gbp pq import to generate pq branch
269 commit to remove d/patches
270 anchor merge with upstream
271 "rebase" of pq branch, each commit with d/patches stripped
274 what about dgit view branch ?
275 ideally, would make pseudomerge over dgit view
276 would need to check that dgit view is actually dgit view of
278 failing that first push will need --overwrite
280 ========================================
285 if merge, look at branches before merge
286 generate new combined branch
287 pseudomerge to overwrite merge
289 current avaiable strategies:
291 maybe launder foreign branch
293 if foreign branch is nmuish, can rebase it onto ours
295 could merge breakwaters (use analyse to find them)
296 merge breakwaters (assuming same upstream)
297 manually construct new patch queue by inspection of
298 the other two patch queues
300 instead of manually constructing patch queue, could use
301 gbp pq export and git merge the patch queues
302 (ie work with interdiffs)
304 if upstreams are different and one is ahead
305 simply treat that as "ours" and
306 do the work to import changes from the other
308 if upstreams have diverged, can
309 resolve somehow to make new upstream
310 do new-upstream on each branch separately
311 now reduced to previously "solved" problem
313 in future, auto patch queue merge algorithm
314 determine next patch to apply
315 there are three versions o..O, l..L, r..R
316 we have already constructed m (previous patch or merged breakwater)
317 try using vector calculus in the implied cube and compute
318 multiple ways to check consistency ?