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'
179 git diff --quiet HEAD refs/heads/$before
182 t-has-ancestor HEAD refs/heads/$before
186 t-refs-same refs/heads/$peel
187 t-refs-same refs/heads/before-unstitch/$startbranch
196 Ec="F:No ongoing git-debrebase session"
197 Ep="F:Patch export produced patch amendments"
200 # stitched? st'd st'd unst'd unst'd convert
201 # laundered? laund'd mixed laund'd mixed -from-gbp
203 # "mixed" means an out of order branch
204 # containing mixed commits and patch additions,
205 # but which needs even more patches
207 subcmd '' Ult Ull Vlt Vl nU
208 subcmd stitch Ns Nu Sltf Stf Ns
209 subcmd prepush ns nu Sltf Stf ns
210 subcmd quick ns Sl Sltf Sl n
211 subcmd conclude "$Ec" "$Ec" Sltf Sl N
212 subcmd scrap Ns Ns Z Z N
213 subcmd make-patches sPft "$Ep" uPft "$Ep" Pn
215 # result codes, each one is a check:
216 # E:$pat } this is an error (must come first)
217 # F:$pat } arg is passed to expect-fail
219 # X should fail due to snags, but succeed when forced
220 # XX crash out of script for manual debugging
222 # N this is a noop, error unless --noop-ok
223 # n this is a silent noop
224 # both of these imply tf; but, specify also one of u s
226 # should normally specify one of these:
227 # U just unstiched: ffq-prev is exactly previous HEAD; implies u
228 # u result is unstitched
229 # V ffq-prev remains unchanged; implies also u
230 # s result is stitched, debrebase-last exists and is unchanged
231 # S result is stitch just made, remaining letters apply to result~
232 # Z result is rewind to before changes made
234 # P result is add-patches, remaining letters apply to result~
236 # should normally specify one or both of these:
237 # l result is laundered, tree is same as before minus d/patches
238 # t tree is exactly same as before
240 # f result is ff from previous HEAD