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