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 case "$checkletters" in
77 t-git-debrebase $xopts $subcmd
83 case "$checkletters" in
85 t-expect-fail "$checkletters" \
86 t-git-debrebase $xopts $subcmd
90 t-git-debrebase $xopts $subcmd
94 peel=peel-$subcmd-$startbranch
96 t-clean-on-branch $peel
98 : "---------- $subcmd $startbranch $checkletters ----------"
100 while [ "x$checkletters" != x ]; do
101 : "---- $subcmd $startbranch ...$checkletters ----"
102 make_check "$checkletters"
103 checkletters="${checkletters#?}"
109 next_checkletter () {
110 checkletters="${checkletters#?}"
117 t-refs-same refs/heads/$before refs/heads/$work
121 t-refs-same refs/heads/$before refs/ffq-prev/heads/$work
125 t-git-get-ref refs/ffq-prev/heads/$work
126 t-refs-notexist refs/debrebase-last/heads/$work
130 t-refs-same refs/ffq-prev/heads/$work \
131 refs/ffq-prev/heads/$startbranch
132 t-refs-notexist refs/debrebase-last/heads/$work
135 t-refs-notexist refs/ffq-prev/heads/$work
137 t-refs-same refs/debrebase-last/heads/$work \
138 refs/debrebase-last/heads/$startbranch
139 t-has-ancestor HEAD refs/debrebase-last/heads/$work
142 t-refs-notexist refs/ffq-prev/heads/$work
143 t-refs-same-start refs/debrebase-last/heads/$work
145 git diff --quiet HEAD^1
146 git diff HEAD^2 | grep $startbranch
147 git reset --hard HEAD^1
150 t-dgit -wgf --quilt=nofix quilt-fixup
151 git diff HEAD~ debian/patches | egrep .
152 git diff --quiet HEAD~ -- ':.' ':!debian/patches'
153 git reset --hard HEAD~
156 git diff --quiet HEAD refs/heads/$before -- ':.' ':!debian/patches'
160 git diff --quiet HEAD refs/heads/$before
163 t-has-ancestor HEAD refs/heads/$before
171 Ec="F:No ongoing git-debrebase session"
172 Ep="F:Patch export produced patch amendments"
175 # stitched? st'd st'd unst'd unst'd
176 # laundered? laund'd mixed laund'd mixed
178 # "mixed" means an out of order branch
179 # containing mixed commits and patch additions,
180 # but which needs even more patches
182 subcmd '' Ult Ull Vlt Vl
183 subcmd stitch Ns Nu Sltf Stf
184 subcmd prepush Ns Nu Sltf Stf
185 subcmd quick ns Sl Sltf Sl
186 subcmd conclude "$Ec" "$Ec" Sltf Sl
187 subcmd make-patches sPft "$Ep" uPft "$Ep"
188 #subcmd dgit-upload-hook Psft "$Ep" SPft "$Ep"
190 # result codes, each one is a check:
191 # E:$pat } this is an error (must come first)
192 # F:$pat } arg is passed to expect-fail
194 # XX crash out of script for manual debugging
196 # N this is a noop, error unless --noop-ok
197 # n this is a silent noop
198 # both of these imply tf; but, specify also one of u s
200 # should normally specify one of these:
201 # U just unstiched: ffq-prev is exactly previous HEAD; implies u
202 # u result is unstitched
203 # V ffq-prev remains unchanged; implies also u
204 # s result is stitched, debrebase-last exists and is unchanged
205 # S result is stitch just made, remaining letters apply to result~
207 # P result is add-patches, remaining letters apply to result~
209 # should normally specify one or both of these:
210 # l result is laundered, tree is same as before minus d/patches
211 # t tree is exactly same as before
213 # f result is ff from previous HEAD