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
66 case "$checkletters" in
68 fail "$checkletters" # for debugging
72 t-git-debrebase $subcmd
73 t-git-debrebase --noop-ok $subcmd
76 t-expect-fail "$checkletters" \
77 t-git-debrebase $subcmd
81 t-git-debrebase $subcmd
85 peel=peel-$subcmd-$startbranch
87 t-clean-on-branch $peel
89 : "---------- $subcmd $startbranch $checkletters ----------"
91 while [ "x$checkletters" != x ]; do
92 : "---- $subcmd $startbranch ...$checkletters ----"
93 make_check "$checkletters"
94 checkletters="${checkletters#?}"
100 next_checkletter () {
101 checkletters="${checkletters#?}"
108 t-refs-same refs/heads/$before refs/heads/$work
112 t-refs-same refs/heads/$before refs/ffq-prev/heads/$work
116 t-git-get-ref refs/ffq-prev/heads/$work
117 t-refs-notexist refs/debrebase-last/heads/$work
121 t-refs-same refs/ffq-prev/heads/$work \
122 refs/ffq-prev/heads/$startbranch
123 t-refs-notexist refs/debrebase-last/heads/$work
126 t-refs-notexist refs/ffq-prev/heads/$work
128 t-refs-same refs/debrebase-last/heads/$work \
129 refs/debrebase-last/heads/$startbranch
130 t-has-ancestor HEAD refs/debrebase-last/heads/$work
133 t-refs-notexist refs/ffq-prev/heads/$work
134 t-refs-same-start refs/debrebase-last/heads/$work
136 git diff --quiet HEAD^1
137 git diff HEAD^2 | grep $startbranch
138 git reset --hard HEAD^1
141 t-dgit -wgf --quilt=nofix quilt-fixup
142 git diff HEAD~ debian/patches | egrep .
143 git diff --quiet HEAD~ -- ':.' ':!debian/patches'
144 git reset --hard HEAD~
147 git diff --quiet HEAD refs/heads/$before -- ':.' ':!debian/patches'
151 git diff --quiet HEAD refs/heads/$before
154 t-has-ancestor HEAD refs/heads/$before
162 Ec="F:No ongoing git-debrebase session"
163 Ep="F:Patch export produced patch amendments"
166 # stitched? st'd st'd unst'd unst'd
167 # laundered? laund'd mixed laund'd mixed
169 # "mixed" means an out of order branch
170 # containing mixed commits and patch additions,
171 # but which needs even more patches
173 subcmd '' Ult Ull Vlt Vl
174 subcmd stitch Ns Nu Sltf Stf
175 subcmd prepush Ns Nu Sltf Stf
176 subcmd quick ns Sl Sltf Sl
177 subcmd conclude "$Ec" "$Ec" Sltf Sl
178 subcmd make-patches sPft "$Ep" uPft "$Ep"
179 #subcmd dgit-upload-hook Psft "$Ep" SPft "$Ep"
181 # result codes, each one is a check:
182 # E:$pat } this is an error (must come first)
183 # F:$pat } arg is passed to expect-fail
185 # N this is a noop, error unless --noop-ok
186 # n this is a silent noop
187 # both of these imply tf; but, specify also one of u s
189 # should normally specify one of these:
190 # U just unstiched: ffq-prev is exactly previous HEAD; implies u
191 # u result is unstitched
192 # V ffq-prev remains unchanged; implies also u
193 # s result is stitched, debrebase-last exists and is unchanged
194 # S result is stitch just made, remaining letters apply to result~
196 # P result is add-patches, remaining letters apply to result~
198 # should normally specify one or both of these:
199 # l result is laundered, tree is same as before minus d/patches
200 # t tree is exactly same as before
202 # f result is ff from previous HEAD