chiark / gitweb /
git-debrebase(5): finished now I think
[dgit.git] / NOTES.git-debrebase
1 TODO
2    reference docs
3       git-debrebase(1)   command line
4    tutorial
5       dgit-maint-debrebase(7)
6       someone should set branch.<name>.mergeOptions to include --ff-only ?
7
8    clean up remains of README
9
10    arrange for dgit to automatically stitch on push
11
12 workflow
13
14   git-debrebase blah [implies start]       strips pseudomerge(s)
15
16   commit / git-debrebase / etc.
17
18   dgit --damp-run push
19       hook: call git-debrebase prep-push   dgit push does not update remote
20       or something, must add patches at least
21
22   commit / git-debrebase / etc.            strips patches
23
24   dgit push
25       hook: call git-debrebase prep-push   dgit push DOES update remote
26
27   commit / git-debrebase / etc.            strips last pm, but arranges
28                                            that remade pm will incorporate it
29
30 ========================================
31
32 Theory for ffq-prev
33
34   refs/ffq-prev/REF    relates to refs/REF
35
36 When we strip a pm, we need to maybe record it (or something) as the
37 new start point.
38
39 When we do a thing
40
41     with no recorded ffq-prev
42
43         ffq-prev is our current tip
44
45         obviously it is safe to say we will overwrite this
46         we do check whether there are not-included changes in the remotes
47         because if the new ffq-prev is not ff from the remotes
48         the later pushes will fail
49
50         this model tends to keep ad-hoc commits made on our
51         tip branch before we did rebase start, in the
52         `interchange view' and also in the rebase stack.
53
54         also we can explicitly preserve with
55         git-debrebase stitch
56
57         It is always safe to rewind ffq-prev: all
58         that does is overwrite _less_ stuff.
59
60         in any case putative ffq-prev must be ff from remote.
61         Otherwise when we push it will not be ff, even though we have
62         made pseudomerge to overwrite ffq-prev.  So if we spot
63         this, report an error.  see above
64
65     with a recorded ffq-prev
66
67         we may need to advance ffq-prev, to allow us to generate
68         future pseudomerges that will be pushable
69
70         advancing ffq-prev is dangerous, since it might
71         effectively cancel the commits that will-ovewrite is advanced
72         over.
73
74         ??? advance it to merge-base( current remote, current tip )
75         if possible (see above), - ie to current remote, subject
76         to the condition that that is an ancestor of current tip
77
78         currently this is not implemented
79
80         better maybe to detect divergence ?  but it is rather late
81         by then!
82
83 We check we are ff from remotes before recording new ffq-prev
84
85   ---------- now follows much the same info in different words ----------
86
87 1. git-debrebase [-i etc.]
88
89      should:
90         check for ffq-prev
91         if is already a ffq-prev, fine, do no more
92         if not:
93
94         check our origin branch exists and we are ff from it
95         if not fail
96
97         check our other might-be-pushed to branches
98         check we are ff from them
99         if not fail
100
101         set ffq-prev to something which is ff from
102           all above branches
103
104         we use our tip, as discussed above
105         (optionally, can use some other commit which is ff
106          from all of the above, eg one of them)
107
108 N. git-debrebase [--noop-ok] record-ffq-prev
109
110      does what is described above
111
112 2. git-debrebase [--noop-ok] stitch
113
114     makes pseudomerge with ffq-prev
115     deletes ffq-prev
116
117     we will teach dgit to do
118        git-debrebase stitch
119     or some such ?
120
121 following parts are not implemented and maybe aren't the
122 best subcommand names etc.
123
124 3. git-debrebase push
125
126     like git push only does stitch first
127     ??? command line parsing!
128
129 4. git-debrebase release
130
131     stiches, finalises changelog, signs tags, pushes everything
132     for the future, when there is some automatic builder
133
134 ========================================
135
136 import from gbp
137
138 what about dgit view branch ?
139 ideally, would make pseudomerge over dgit view
140 would need to check that dgit view is actually dgit view of
141   ond of our ancestors
142 failing that first push will need --overwrite
143 that is what is currently implemented
144
145 ========================================
146
147 how to handle divergence and merges (if not detected soon enough)
148
149 same problem
150  if merge, look at branches before merge
151  generate new combined branch
152  pseudomerge to overwrite merge
153
154 current avaiable strategies:
155
156  maybe launder foreign branch
157
158  if foreign branch is nmuish, can rebase it onto ours
159
160  could merge breakwaters (use analyse to find them)
161  merge breakwaters (assuming same upstream)
162  manually construct new patch queue by inspection of
163   the other two patch queues
164
165  instead of manually constructing patch queue, could use
166   gbp pq export and git merge the patch queues
167   (ie work with interdiffs)
168
169  if upstreams are different and one is ahead
170   simply treat that as "ours" and
171   do the work to import changes from the other
172
173  if upstreams have diverged, can
174   resolve somehow to make new upstream
175   do new-upstream on each branch separately
176   now reduced to previously "solved" problem
177
178  in future, auto patch queue merge algorithm
179   determine next patch to apply
180   there are three versions o..O, l..L, r..R
181   we have already constructed m (previous patch or merged breakwater)
182   try using vector calculus in the implied cube and compute
183    multiple ways to check consistency ?
184
185 ========================================
186
187 For downstreams of Debian, sketch of git-ffqrebase
188
189 #    git-ffqrebase start [BASE]
190 #                # records previous HEAD so it can be overwritten
191 #                # records base for future git-ffqrebase
192 #    git-ffqrebase set-base BASE
193 #    git-ffqrebase <git-rebase options>
194 #    git-ffqrebase finish
195 #    git-ffqrebase status [BRANCH]