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 stitched-laundered master
31 t-gdr-good stitched HEAD
33 git checkout -b stitched-mixed master
36 git checkout -b unstitched-laundered master
41 git checkout -b unstitched-mixed master
52 for startbranch in {stitched,unstitched}-{laundered,mixed}; do
53 work="work-$subcmd-$startbranch"
55 : "---------- $subcmd $startbranch ----------"
57 git for-each-ref "**/$startbranch"{,/**} \
58 --format='create %(refname) %(objectname)' \
59 | sed "s/$startbranch/$work/" \
60 | git update-ref --stdin
63 checkletters=$1; shift
70 case "$checkletters" in
72 fail "$checkletters" # for debugging
76 case "$checkletters" in
78 t-expect-fail E:'snags: [0-9]* blockers' \
79 t-git-debrebase $xopts $subcmd
85 case "$checkletters" in
88 t-git-debrebase $xopts $subcmd
94 case "$checkletters" in
96 t-expect-fail "$checkletters" \
97 t-git-debrebase $xopts $subcmd
101 t-git-debrebase $xopts $subcmd
105 peel=peel-$subcmd-$startbranch
106 git checkout -b $peel
107 t-clean-on-branch $peel
109 : "---------- $subcmd $startbranch $checkletters ----------"
111 while [ "x$checkletters" != x ]; do
112 : "---- $subcmd $startbranch ...$checkletters ----"
113 make_check "$checkletters"
114 checkletters="${checkletters#?}"
120 next_checkletter () {
121 checkletters="${checkletters#?}"
128 t-refs-same refs/heads/$before refs/heads/$work
132 t-refs-same refs/heads/$before refs/ffq-prev/heads/$work
136 t-git-get-ref refs/ffq-prev/heads/$work
137 t-refs-notexist refs/debrebase-last/heads/$work
141 t-refs-same refs/ffq-prev/heads/$work \
142 refs/ffq-prev/heads/$startbranch
143 t-refs-notexist refs/debrebase-last/heads/$work
146 t-refs-notexist refs/ffq-prev/heads/$work
148 t-refs-same refs/debrebase-last/heads/$work \
149 refs/debrebase-last/heads/$startbranch
150 t-has-ancestor HEAD refs/debrebase-last/heads/$work
153 t-refs-notexist refs/ffq-prev/heads/$work
154 t-refs-same-start refs/debrebase-last/heads/$work
156 git diff --quiet HEAD^1
157 git diff HEAD^2 | grep $startbranch
158 git reset --hard HEAD^1
161 t-dgit -wgf --quilt=nofix quilt-fixup
162 git diff HEAD~ debian/patches | egrep .
163 git diff --quiet HEAD~ -- ':.' ':!debian/patches'
164 git reset --hard HEAD~
167 git diff --quiet HEAD refs/heads/$before -- ':.' ':!debian/patches'
171 git diff --quiet HEAD refs/heads/$before
174 t-has-ancestor HEAD refs/heads/$before
182 Ec="F:No ongoing git-debrebase session"
183 Ep="F:Patch export produced patch amendments"
186 # stitched? st'd st'd unst'd unst'd
187 # laundered? laund'd mixed laund'd mixed
189 # "mixed" means an out of order branch
190 # containing mixed commits and patch additions,
191 # but which needs even more patches
193 subcmd '' Ult Ull Vlt Vl
194 subcmd stitch Ns Nu Sltf Stf
195 subcmd prepush Ns Nu Sltf Stf
196 subcmd quick ns Sl Sltf Sl
197 subcmd conclude "$Ec" "$Ec" Sltf Sl
198 subcmd make-patches sPft "$Ep" uPft "$Ep"
199 #subcmd dgit-upload-hook Psft "$Ep" SPft "$Ep"
201 # result codes, each one is a check:
202 # E:$pat } this is an error (must come first)
203 # F:$pat } arg is passed to expect-fail
205 # X should fail due to snags, but succeed when forced
206 # XX crash out of script for manual debugging
208 # N this is a noop, error unless --noop-ok
209 # n this is a silent noop
210 # both of these imply tf; but, specify also one of u s
212 # should normally specify one of these:
213 # U just unstiched: ffq-prev is exactly previous HEAD; implies u
214 # u result is unstitched
215 # V ffq-prev remains unchanged; implies also u
216 # s result is stitched, debrebase-last exists and is unchanged
217 # S result is stitch just made, remaining letters apply to result~
219 # P result is add-patches, remaining letters apply to result~
221 # should normally specify one or both of these:
222 # l result is laundered, tree is same as before minus d/patches
223 # t tree is exactly same as before
225 # f result is ff from previous HEAD