3 My preferred answer is that it is a constantly rebasing branch topped
4 with a series of pseudomerges to make it fast-forwarding.
6 ------/--A!----/--B3!--%--/--> interchange view
7 / / / with debian/ directory
8 % % % all upstream changes applied
9 / / / 3.0 (quilt) has debian/patches
14 1 1 1 `breakwater' branch, merging baseline
15 / / / unmodified upstream code
16 ---@-----@--A----@--B--C plus debian/ (but no debian/patches)
17 / / / no ref refers to this: we
18 --#-----#-------#-----> upstream reconstruct its identity by
19 inspecting interchange branch
22 1,2,3 commits touching upstream files only
23 A,B,C commits touching debian/ only
24 B3 mixed commit (eg made by an NMUer)
27 -@- anchor merge, takes contents of debian/ from the
28 / previous `breakwater' commit and rest from upstream
30 -/- pseudomerge; contents are identical to
31 / parent lower on diagram.
33 % dgit-generated commit of debian/patches.
34 `3.0 (quilt)' only; dropped by rebase tool.
36 * Maintainer's HEAD was here while they were editing,
37 before they said they were done, at which point their
38 tools generated [% and] -/- commit[s] to convert to
39 the fast-forwarding interchange branch. (Maybe the
40 tooling is simply `dgit push'.)
42 ! NMUer's HEAD was here when they said `dgit push'.
43 Rebase branch launderer turns each ! into an
47 Looking from the tip of the interchange view, it is I think always
48 possible to classify these commits appropriately: pseudomerges are
49 fairly obvious (if all three trees are identical, we descend to the
50 parent with the most recent commit date). The `@' special merge is
51 the only non-pseudo merge and has a special form; also, it will be
52 generated only by our tools so can have an annotation in the commit
55 So it would be possible to write a `git-debrebase' tool which would
56 take (for example) B4, above, and be able to perform functions like:
58 * Strip pseudomerges: Rewrite the current branch so it contains no
59 pseudomerges, turning ...B3 into ...@-A-1-2-B3. (This should
60 make a note, in your .git/ somewhere, of the original branch
61 tip so that it can be overwritten with a pseudomerge.)
63 * Cleanup branch: Reorganise the current branch so that the debian/
64 changes come first, turning -@-A-1-2-B3 into ...@-A-B-1-2-3.
66 * New upstream rebase: Start rebasing onto a new upstream version,
67 turning ...#..@-A-B-1-2-3 into (...#..@-A-B-|...#'-)@'-1-2. This
68 would be a wrapper around git-rebase, which prepares @' and then
69 tries to rebase 1 2 onto @'. So if you ask for an interactive
70 rebase @' doesn't appear in your commit list.
72 Note that the construction of @' cannot fail because @' simply
73 copies debian/ from B and and everything else from #'. (Rebasing A
74 and B is undesirable. We want the debian/ files to be non-rebasing
75 so we can `git log' and get the packaging history.)
77 * Record pseudomerge. This is like "committing" your patch queue.
78 The LH parent is taken from the previously recorded tip. (We could
79 perhaps check that this is consistent with what we see in
80 debian/changelog, but that is not a sufficient check so the
81 recorded tip check is primary.)
83 Maybe some of these operations should automatically edit
86 Nonlinear (merging) history in the interchange branch is awkward
87 because it (obviously) does not preserve the patch queue.
89 Nonlinear (merging) history in the `packaging-only' branch is OK, if
90 we could generate it. We will use the commit message annotation to
91 distinguish a merge of two `packaging-only' branches from the special
92 merge `@'. (Indeed I since upstream might copy debian/ from us,
93 without the annotation and knowledge of the construction order it is
94 not easy to reliably distinguish the two parents of a `@'. In the
95 most exciting edge case, upstream might `git merge' a previous
96 instance of our interchange view, but I think even then everything
99 Sean Whitton writes ("Re: Feedback on 3.0 source format problems"):
100 > Does the [breakwater] branch contain debian/ alone?
102 No, it also contains a complete unmodified copy of the upstream code.
103 (Except that if upstream had a debian/ directory, it is completely
106 For `3.0 (quilt)' the breakwater branch contains roughly what you
107 would get if you untarred the origs and the debian.tar.gz, and then
108 deleted all the patches without applying them.
114 Consider a non-dgit NMU followed by a dgit NMU:
118 interchange --/--B3!--%--/----D*-->
131 --#--------> upstream
136 =XBC% dgit tarball import of .debian.tar.gz containing
137 Debian packaging including changes B C and patches
139 0 dgit tarball import of upstream tarball
140 00 dgit tarball import of supplementary upstream tarball
141 &_ dgit nearly-breakwater import
142 &' git-debrebase converted import (upstream files only)
143 D' git-debrebase converted debian/ changes import
145 * ** before and after HEAD
147 Want to transform this into:
149 I. No new upstream version (0 + 00 eq #)
151 --/--B3!--%--/------D*-------------/-->
162 --@--A-----B-----------------------C--D
164 --#----------------------------------------->
167 II. New upstream (0 + 00 neq #)
169 --/--B3!--%--/------D*-------------/-->
180 --@--A-----B--------------------@--C--D
182 --#----------------------- - - / - - ----->