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 .
171 git diff --quiet HEAD~ -- ':.' ':!debian/patches'
172 git reset --hard HEAD~
175 git diff --quiet HEAD refs/heads/$before -- ':.' ':!debian/patches'
180 refs/ffq-prev/heads/$work \
181 refs/debrebase-last/heads/$work
184 git diff --quiet HEAD refs/heads/$before
187 t-has-ancestor HEAD refs/heads/$before
191 t-refs-same refs/heads/$peel
192 t-refs-same refs/heads/before-unstitch/$startbranch
201 Ec="F:No ongoing git-debrebase session"
202 Ep="F:Patch export produced patch amendments"
205 # stitched? st'd st'd unst'd unst'd convert
206 # laundered? laund'd mixed laund'd mixed -from-gbp
208 # "mixed" means an out of order branch
209 # containing mixed commits and patch additions,
210 # but which needs even more patches
212 subcmd '' Ult Ull Vlt Vl nU
213 subcmd stitch Ns Nu Sltf Stf Ns
214 subcmd prepush ns nu Sltf Stf ns
215 subcmd quick ns Sl Sltf Sl n
216 subcmd conclude "$Ec" "$Ec" Sltf Sl N
217 subcmd scrap Ns Ns Z Z N
218 subcmd make-patches sPft "$Ep" uPft "$Ep" Pn
219 subcmd forget-was-ever-debrebase nA nA nA nA nA
221 # result codes, each one is a check:
222 # E:$pat } this is an error (must come first)
223 # F:$pat } arg is passed to expect-fail
225 # X should fail due to snags, but succeed when forced
226 # XX crash out of script for manual debugging
228 # N this is a noop, error unless --noop-ok
229 # n this is a silent noop
230 # both of these imply tf; but, specify also one of u s
232 # should normally specify one of these:
233 # U just unstiched: ffq-prev is exactly previous HEAD; implies u
234 # u result is unstitched
235 # V ffq-prev remains unchanged; implies also u
236 # s result is stitched, debrebase-last exists and is unchanged
237 # S result is stitch just made, remaining letters apply to result~
238 # Z result is rewind to before changes made
239 # A no ffq-prev or debrebase-last refs ("Amnesia")
241 # P result is add-patches, remaining letters apply to result~
243 # should normally specify one or both of these:
244 # l result is laundered, tree is same as before minus d/patches
245 # t tree is exactly same as before
247 # f result is ff from previous HEAD