5 t-dependencies git-buildpackage libfile-fnmatch-perl faketime
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 t-dgit -wgf quilt-fixup
22 t-some-changes "subcommands $m 2"
26 git checkout -b stitched-laundered master
29 t-gdr-good stitched HEAD
31 git checkout -b stitched-mixed master
34 git checkout -b unstitched-laundered master
39 git checkout -b unstitched-mixed master
50 for startbranch in {stitched,unstitched}-{laundered,mixed}; do
51 work="work-$subcmd-$startbranch"
53 : "---------- $subcmd $startbranch ----------"
55 git for-each-ref "**/$startbranch"{,/**} \
56 --format='create %(refname) %(objectname)' \
57 | sed "s/$startbranch/$work/" \
58 | git update-ref --stdin
61 checkletters=$1; shift
68 case "$checkletters" in
70 fail "$checkletters" # for debugging
74 t-git-debrebase $xopts $subcmd
75 t-git-debrebase $xopts --noop-ok $subcmd
78 t-expect-fail "$checkletters" \
79 t-git-debrebase $xopts $subcmd
83 t-git-debrebase $xopts $subcmd
87 peel=peel-$subcmd-$startbranch
89 t-clean-on-branch $peel
91 : "---------- $subcmd $startbranch $checkletters ----------"
93 while [ "x$checkletters" != x ]; do
94 : "---- $subcmd $startbranch ...$checkletters ----"
95 make_check "$checkletters"
96 checkletters="${checkletters#?}"
102 next_checkletter () {
103 checkletters="${checkletters#?}"
110 t-refs-same refs/heads/$before refs/heads/$work
114 t-refs-same refs/heads/$before refs/ffq-prev/heads/$work
118 t-git-get-ref refs/ffq-prev/heads/$work
119 t-refs-notexist refs/debrebase-last/heads/$work
123 t-refs-same refs/ffq-prev/heads/$work \
124 refs/ffq-prev/heads/$startbranch
125 t-refs-notexist refs/debrebase-last/heads/$work
128 t-refs-notexist refs/ffq-prev/heads/$work
130 t-refs-same refs/debrebase-last/heads/$work \
131 refs/debrebase-last/heads/$startbranch
132 t-has-ancestor HEAD refs/debrebase-last/heads/$work
135 t-refs-notexist refs/ffq-prev/heads/$work
136 t-refs-same-start refs/debrebase-last/heads/$work
138 git diff --quiet HEAD^1
139 git diff HEAD^2 | grep $startbranch
140 git reset --hard HEAD^1
143 t-dgit -wgf --quilt=nofix quilt-fixup
144 git diff HEAD~ debian/patches | egrep .
145 git diff --quiet HEAD~ -- ':.' ':!debian/patches'
146 git reset --hard HEAD~
149 git diff --quiet HEAD refs/heads/$before -- ':.' ':!debian/patches'
153 git diff --quiet HEAD refs/heads/$before
156 t-has-ancestor HEAD refs/heads/$before
164 Ec="F:No ongoing git-debrebase session"
165 Ep="F:Patch export produced patch amendments"
168 # stitched? st'd st'd unst'd unst'd
169 # laundered? laund'd mixed laund'd mixed
171 # "mixed" means an out of order branch
172 # containing mixed commits and patch additions,
173 # but which needs even more patches
175 subcmd '' Ult Ull Vlt Vl
176 subcmd stitch Ns Nu Sltf Stf
177 subcmd prepush Ns Nu Sltf Stf
178 subcmd quick ns Sl Sltf Sl
179 subcmd conclude "$Ec" "$Ec" Sltf Sl
180 subcmd make-patches sPft "$Ep" uPft "$Ep"
181 #subcmd dgit-upload-hook Psft "$Ep" SPft "$Ep"
183 # result codes, each one is a check:
184 # E:$pat } this is an error (must come first)
185 # F:$pat } arg is passed to expect-fail
187 # XX crash out of script for manual debugging
189 # N this is a noop, error unless --noop-ok
190 # n this is a silent noop
191 # both of these imply tf; but, specify also one of u s
193 # should normally specify one of these:
194 # U just unstiched: ffq-prev is exactly previous HEAD; implies u
195 # u result is unstitched
196 # V ffq-prev remains unchanged; implies also u
197 # s result is stitched, debrebase-last exists and is unchanged
198 # S result is stitch just made, remaining letters apply to result~
200 # P result is add-patches, remaining letters apply to result~
202 # should normally specify one or both of these:
203 # l result is laundered, tree is same as before minus d/patches
204 # t tree is exactly same as before
206 # f result is ff from previous HEAD