7 t-tstunt-parsechangelog
8 t-setup-import gdr-convert-gbp
12 t-dgit setup-mergechangelogs
17 local m=$(git symbolic-ref HEAD)
18 t-some-changes "subcommands $m 1"
20 # we want patches mde by dgit, not gdr, for our test cases
21 t-dgit --git-debrebase=true -wgf quilt-fixup
24 t-some-changes "subcommands $m 2"
28 git checkout -b raw-converted-from-gbp converted-from-gbp
29 test "$(git diff --stat HEAD^2)"
30 git diff --exit-code --stat HEAD^1
31 git reset --hard HEAD^1
33 git checkout -b stitched-laundered master
36 t-gdr-good stitched HEAD
38 git checkout -b stitched-mixed master
41 git checkout -b unstitched-laundered master
43 git branch before-unstitch/unstitched-laundered
47 git checkout -b unstitched-mixed master
48 git branch before-unstitch/unstitched-mixed
59 for startbranch in {stitched,unstitched}-{laundered,mixed} \
60 raw-converted-from-gbp; do
61 work="work-$subcmd-$startbranch"
63 : "---------- $subcmd $startbranch ----------"
65 git for-each-ref "**/$startbranch"{,/**} \
66 --format='create %(refname) %(objectname)' \
67 | sed "s/$startbranch/$work/" \
68 | git update-ref --stdin
71 checkletters=$1; shift
78 case "$checkletters" in
80 fail "$checkletters" # for debugging
84 case "$checkletters" in
86 t-expect-fail E:'snags: [0-9]* blockers' \
87 t-git-debrebase $xopts $subcmd
93 case "$checkletters" in
96 t-git-debrebase $xopts $subcmd
102 case "$checkletters" in
104 t-expect-fail "$checkletters" \
105 t-git-debrebase $xopts $subcmd
109 t-git-debrebase $xopts $subcmd
113 peel=peel-$subcmd-$startbranch
114 git checkout -b $peel
115 t-clean-on-branch $peel
117 : "---------- $subcmd $startbranch $checkletters ----------"
119 while [ "x$checkletters" != x ]; do
120 : "---- $subcmd $startbranch ...$checkletters ----"
121 make_check "$checkletters"
122 checkletters="${checkletters#?}"
128 next_checkletter () {
129 checkletters="${checkletters#?}"
136 t-refs-same refs/heads/$before refs/heads/$peel
140 t-refs-same refs/heads/$before refs/ffq-prev/heads/$work
144 t-git-get-ref refs/ffq-prev/heads/$work
145 t-refs-notexist refs/debrebase-last/heads/$work
149 t-refs-same refs/ffq-prev/heads/$work \
150 refs/ffq-prev/heads/$startbranch
151 t-refs-notexist refs/debrebase-last/heads/$work
154 t-refs-notexist refs/ffq-prev/heads/$work
156 t-refs-same refs/debrebase-last/heads/$work \
157 refs/debrebase-last/heads/$startbranch
158 t-has-ancestor HEAD refs/debrebase-last/heads/$work
161 t-refs-notexist refs/ffq-prev/heads/$work
162 t-refs-same-start refs/debrebase-last/heads/$work
164 git diff --quiet HEAD^1
165 git diff HEAD^2 | grep $startbranch
166 git reset --hard HEAD^1
169 t-dgit -wgf --quilt=nofix quilt-fixup
170 git diff HEAD~ debian/patches | egrep .
172 git diff --quiet HEAD~ -- ':.' ':!debian/patches'
173 git reset --hard HEAD~
176 git diff --quiet HEAD refs/heads/$before -- ':.' ':!debian/patches'
181 refs/ffq-prev/heads/$work \
182 refs/debrebase-last/heads/$work
185 git diff --quiet HEAD refs/heads/$before
188 t-has-ancestor HEAD refs/heads/$before
192 t-refs-same refs/heads/$peel
193 t-refs-same refs/heads/before-unstitch/$startbranch
202 Ec="F:No ongoing git-debrebase session"
203 Ep="F:Patch export produced patch amendments"
206 # stitched? st'd st'd unst'd unst'd convert
207 # laundered? laund'd mixed laund'd mixed -from-gbp
209 # "mixed" means an out of order branch
210 # containing mixed commits and patch additions,
211 # but which needs even more patches
213 subcmd '' Ult Ull Vlt Vl nU
214 subcmd stitch Ns Nu Sltf Stf Ns
215 subcmd prepush ns nu Sltf Stf ns
216 subcmd quick ns Sl Sltf Sl n
217 subcmd conclude "$Ec" "$Ec" Sltf Sl N
218 subcmd scrap Ns Ns Z Z N
219 subcmd make-patches sPft "$Ep" uPft "$Ep" Pn
220 subcmd forget-was-ever-debrebase nA nA nA nA nA
222 # result codes, each one is a check:
223 # E:$pat } this is an error (must come first)
224 # F:$pat } arg is passed to expect-fail
226 # X should fail due to snags, but succeed when forced
227 # XX crash out of script for manual debugging
229 # N this is a noop, error unless --noop-ok
230 # n this is a silent noop
231 # both of these imply tf; but, specify also one of u s
233 # should normally specify one of these:
234 # U just unstiched: ffq-prev is exactly previous HEAD; implies u
235 # u result is unstitched
236 # V ffq-prev remains unchanged; implies also u
237 # s result is stitched, debrebase-last exists and is unchanged
238 # S result is stitch just made, remaining letters apply to result~
239 # Z result is rewind to before changes made
240 # A no ffq-prev or debrebase-last refs ("Amnesia")
242 # P result is add-patches, remaining letters apply to result~
244 # should normally specify one or both of these:
245 # l result is laundered, tree is same as before minus d/patches
246 # t tree is exactly same as before
248 # f result is ff from previous HEAD