7 t-setup-import gdr-convert-gbp
11 t-dgit setup-mergechangelogs
16 local m=$(git symbolic-ref HEAD)
17 t-some-changes "subcommands $m 1"
19 # we want patches mde by dgit, not gdr, for our test cases
20 t-dgit --git-debrebase=true -wgf quilt-fixup
23 t-some-changes "subcommands $m 2"
27 git checkout -b stitched-laundered master
30 t-gdr-good stitched HEAD
32 git checkout -b stitched-mixed master
35 git checkout -b unstitched-laundered master
40 git checkout -b unstitched-mixed master
51 for startbranch in {stitched,unstitched}-{laundered,mixed}; do
52 work="work-$subcmd-$startbranch"
54 : "---------- $subcmd $startbranch ----------"
56 git for-each-ref "**/$startbranch"{,/**} \
57 --format='create %(refname) %(objectname)' \
58 | sed "s/$startbranch/$work/" \
59 | git update-ref --stdin
62 checkletters=$1; shift
69 case "$checkletters" in
71 fail "$checkletters" # for debugging
75 case "$checkletters" in
77 t-expect-fail E:'snags: [0-9]* blockers' \
78 t-git-debrebase $xopts $subcmd
84 case "$checkletters" in
87 t-git-debrebase $xopts $subcmd
93 case "$checkletters" in
95 t-expect-fail "$checkletters" \
96 t-git-debrebase $xopts $subcmd
100 t-git-debrebase $xopts $subcmd
104 peel=peel-$subcmd-$startbranch
105 git checkout -b $peel
106 t-clean-on-branch $peel
108 : "---------- $subcmd $startbranch $checkletters ----------"
110 while [ "x$checkletters" != x ]; do
111 : "---- $subcmd $startbranch ...$checkletters ----"
112 make_check "$checkletters"
113 checkletters="${checkletters#?}"
119 next_checkletter () {
120 checkletters="${checkletters#?}"
127 t-refs-same refs/heads/$before refs/heads/$work
131 t-refs-same refs/heads/$before refs/ffq-prev/heads/$work
135 t-git-get-ref refs/ffq-prev/heads/$work
136 t-refs-notexist refs/debrebase-last/heads/$work
140 t-refs-same refs/ffq-prev/heads/$work \
141 refs/ffq-prev/heads/$startbranch
142 t-refs-notexist refs/debrebase-last/heads/$work
145 t-refs-notexist refs/ffq-prev/heads/$work
147 t-refs-same refs/debrebase-last/heads/$work \
148 refs/debrebase-last/heads/$startbranch
149 t-has-ancestor HEAD refs/debrebase-last/heads/$work
152 t-refs-notexist refs/ffq-prev/heads/$work
153 t-refs-same-start refs/debrebase-last/heads/$work
155 git diff --quiet HEAD^1
156 git diff HEAD^2 | grep $startbranch
157 git reset --hard HEAD^1
160 t-dgit -wgf --quilt=nofix quilt-fixup
161 git diff HEAD~ debian/patches | egrep .
162 git diff --quiet HEAD~ -- ':.' ':!debian/patches'
163 git reset --hard HEAD~
166 git diff --quiet HEAD refs/heads/$before -- ':.' ':!debian/patches'
170 git diff --quiet HEAD refs/heads/$before
173 t-has-ancestor HEAD refs/heads/$before
181 Ec="F:No ongoing git-debrebase session"
182 Ep="F:Patch export produced patch amendments"
185 # stitched? st'd st'd unst'd unst'd
186 # laundered? laund'd mixed laund'd mixed
188 # "mixed" means an out of order branch
189 # containing mixed commits and patch additions,
190 # but which needs even more patches
192 subcmd '' Ult Ull Vlt Vl
193 subcmd stitch Ns Nu Sltf Stf
194 subcmd prepush Ns Nu Sltf Stf
195 subcmd quick ns Sl Sltf Sl
196 subcmd conclude "$Ec" "$Ec" Sltf Sl
197 subcmd make-patches sPft "$Ep" uPft "$Ep"
198 #subcmd dgit-upload-hook Psft "$Ep" SPft "$Ep"
200 # result codes, each one is a check:
201 # E:$pat } this is an error (must come first)
202 # F:$pat } arg is passed to expect-fail
204 # X should fail due to snags, but succeed when forced
205 # XX crash out of script for manual debugging
207 # N this is a noop, error unless --noop-ok
208 # n this is a silent noop
209 # both of these imply tf; but, specify also one of u s
211 # should normally specify one of these:
212 # U just unstiched: ffq-prev is exactly previous HEAD; implies u
213 # u result is unstitched
214 # V ffq-prev remains unchanged; implies also u
215 # s result is stitched, debrebase-last exists and is unchanged
216 # S result is stitch just made, remaining letters apply to result~
218 # P result is add-patches, remaining letters apply to result~
220 # should normally specify one or both of these:
221 # l result is laundered, tree is same as before minus d/patches
222 # t tree is exactly same as before
224 # f result is ff from previous HEAD