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
38 git branch before-unstitch/unstitched-laundered
42 git checkout -b unstitched-mixed master
43 git branch before-unstitch/unstitched-mixed
54 for startbranch in {stitched,unstitched}-{laundered,mixed}; do
55 work="work-$subcmd-$startbranch"
57 : "---------- $subcmd $startbranch ----------"
59 git for-each-ref "**/$startbranch"{,/**} \
60 --format='create %(refname) %(objectname)' \
61 | sed "s/$startbranch/$work/" \
62 | git update-ref --stdin
65 checkletters=$1; shift
72 case "$checkletters" in
74 fail "$checkletters" # for debugging
78 case "$checkletters" in
80 t-expect-fail E:'snags: [0-9]* blockers' \
81 t-git-debrebase $xopts $subcmd
87 case "$checkletters" in
90 t-git-debrebase $xopts $subcmd
96 case "$checkletters" in
98 t-expect-fail "$checkletters" \
99 t-git-debrebase $xopts $subcmd
103 t-git-debrebase $xopts $subcmd
107 peel=peel-$subcmd-$startbranch
108 git checkout -b $peel
109 t-clean-on-branch $peel
111 : "---------- $subcmd $startbranch $checkletters ----------"
113 while [ "x$checkletters" != x ]; do
114 : "---- $subcmd $startbranch ...$checkletters ----"
115 make_check "$checkletters"
116 checkletters="${checkletters#?}"
122 next_checkletter () {
123 checkletters="${checkletters#?}"
130 t-refs-same refs/heads/$before refs/heads/$work
134 t-refs-same refs/heads/$before refs/ffq-prev/heads/$work
138 t-git-get-ref refs/ffq-prev/heads/$work
139 t-refs-notexist refs/debrebase-last/heads/$work
143 t-refs-same refs/ffq-prev/heads/$work \
144 refs/ffq-prev/heads/$startbranch
145 t-refs-notexist refs/debrebase-last/heads/$work
148 t-refs-notexist refs/ffq-prev/heads/$work
150 t-refs-same refs/debrebase-last/heads/$work \
151 refs/debrebase-last/heads/$startbranch
152 t-has-ancestor HEAD refs/debrebase-last/heads/$work
155 t-refs-notexist refs/ffq-prev/heads/$work
156 t-refs-same-start refs/debrebase-last/heads/$work
158 git diff --quiet HEAD^1
159 git diff HEAD^2 | grep $startbranch
160 git reset --hard HEAD^1
163 t-dgit -wgf --quilt=nofix quilt-fixup
164 git diff HEAD~ debian/patches | egrep .
165 git diff --quiet HEAD~ -- ':.' ':!debian/patches'
166 git reset --hard HEAD~
169 git diff --quiet HEAD refs/heads/$before -- ':.' ':!debian/patches'
173 git diff --quiet HEAD refs/heads/$before
176 t-has-ancestor HEAD refs/heads/$before
180 t-refs-same refs/heads/$work
181 t-refs-same refs/heads/before-unstitch/$startbranch
190 Ec="F:No ongoing git-debrebase session"
191 Ep="F:Patch export produced patch amendments"
194 # stitched? st'd st'd unst'd unst'd
195 # laundered? laund'd mixed laund'd mixed
197 # "mixed" means an out of order branch
198 # containing mixed commits and patch additions,
199 # but which needs even more patches
201 subcmd '' Ult Ull Vlt Vl
202 subcmd stitch Ns Nu Sltf Stf
203 subcmd prepush Ns Nu Sltf Stf
204 subcmd quick ns Sl Sltf Sl
205 subcmd conclude "$Ec" "$Ec" Sltf Sl
206 subcmd scrap Ns Ns Z Z
207 subcmd make-patches sPft "$Ep" uPft "$Ep"
209 # result codes, each one is a check:
210 # E:$pat } this is an error (must come first)
211 # F:$pat } arg is passed to expect-fail
213 # X should fail due to snags, but succeed when forced
214 # XX crash out of script for manual debugging
216 # N this is a noop, error unless --noop-ok
217 # n this is a silent noop
218 # both of these imply tf; but, specify also one of u s
220 # should normally specify one of these:
221 # U just unstiched: ffq-prev is exactly previous HEAD; implies u
222 # u result is unstitched
223 # V ffq-prev remains unchanged; implies also u
224 # s result is stitched, debrebase-last exists and is unchanged
225 # S result is stitch just made, remaining letters apply to result~
226 # Z result is rewind to before changes made
228 # P result is add-patches, remaining letters apply to result~
230 # should normally specify one or both of these:
231 # l result is laundered, tree is same as before minus d/patches
232 # t tree is exactly same as before
234 # f result is ff from previous HEAD