5 t-dependencies git-buildpackage libfile-fnmatch-perl faketime
7 t-setup-import gdr-convert-gbp
11 t-dgit setup-mergechangelogs
15 local m=$(git symbolic-ref HEAD)
16 t-some-changes "subcommands $m 1"
17 t-dgit -wgf quilt-fixup
18 t-some-changes "subcommands $m 2"
21 git checkout -b stitched-laundered master
24 t-gdr-good stitched HEAD
26 git checkout -b stitched-mixed master
29 git checkout -b unstitched-laundered master
34 git checkout -b unstitched-mixed master
45 for startbranch in {stitched,unstitched}-{laundered,mixed}; do
46 work="work-$subcmd-$startbranch"
48 : "---------- $subcmd $startbranch ----------"
50 git for-each-ref "**/$startbranch"{,/**} \
51 --format='create %(refname) %(objectname)' \
52 | sed "s/$startbranch/$work/" \
53 | git update-ref --stdin
56 checkletters=$1; shift
61 case "$checkletters" in
63 fail "$checkletters" # for debugging
67 t-git-debrebase $subcmd
68 t-git-debrebase --noop-ok $subcmd
71 t-expect-fail "$checkletters" \
72 t-git-debrebase $subcmd
76 t-git-debrebase $subcmd
80 peel=peel-$subcmd-$startbranch
82 t-clean-on-branch $peel
84 : "---------- $subcmd $startbranch $checkletters ----------"
86 while [ "x$checkletters" != x ]; do
87 : "---- $subcmd $startbranch ...$checkletters ----"
88 make_check "$checkletters"
89 checkletters="${checkletters#?}"
96 checkletters="${checkletters#?}"
103 t-refs-same refs/heads/$before refs/heads/$work
107 t-refs-same refs/heads/$before refs/ffq-prev/heads/$work
111 t-git-get-ref refs/ffq-prev/heads/$work
112 t-refs-notexist refs/debrebase-last/heads/$work
116 t-refs-same refs/ffq-prev/heads/$work \
117 refs/ffq-prev/heads/$startbranch
118 t-refs-notexist refs/debrebase-last/heads/$work
121 t-refs-notexist refs/ffq-prev/heads/$work
123 t-refs-same refs/debrebase-last/heads/$work \
124 refs/debrebase-last/heads/$startbranch
125 t-has-ancestor HEAD refs/debrebase-last/heads/$work
128 t-refs-notexist refs/ffq-prev/heads/$work
129 t-refs-same-start refs/debrebase-last/heads/$work
131 git diff --quiet HEAD^1
132 git diff HEAD^2 | grep $startbranch
133 git reset --hard HEAD^1
136 t-dgit -wgf --quilt=check quilt-fixup
137 git diff HEAD~ debian/patches | egrep .
138 git diff --quiet HEAD~ -- ':.' ':!debian/patches'
139 git reset --hard HEAD~
142 git diff --quiet HEAD refs/heads/$before -- ':.' ':!debian/patches'
146 git diff --quiet HEAD refs/heads/$before
149 t-has-ancestor HEAD refs/heads/$before
157 Ec="F:No ongoing git-debrebase session"
160 # stitched? st'd st'd unst'd unst'd
161 # laundered? laund'd mixed laund'd mixed
163 # "mixed" means an out of order branch
164 # containing mixed commits and patch additions,
165 # but which needs even more patches
167 subcmd '' Ult Ull Vlt Vl
168 subcmd stitch Ns Nu Sltf Stf
169 subcmd prepush Ns Nu Sltf Stf
170 subcmd quick ns Sl Sltf Sl
171 subcmd conclude "$Ec" "$Ec" Sltf Sl
172 #subcmd make-patches sPft sPft uPft uPft
173 #subcmd dgit-upload-hook Psft Psft SPft SPft
175 # result codes, each one is a check:
176 # E:$pat } this is an error (must come first)
177 # F:$pat } arg is passed to expect-fail
179 # N this is a noop, error unless --noop-ok
180 # n this is a silent noop
181 # both of these imply tf; but, specify also one of u s
183 # should normally specify one of these:
184 # U just unstiched: ffq-prev is exactly previous HEAD; implies u
185 # u result is unstitched
186 # V ffq-prev remains unchanged; implies also u
187 # s result is stitched, debrebase-last exists and is unchanged
188 # S result is stitch just made, remaining letters apply to result~
190 # P result is add-patches, remaining letters apply to result~
192 # should normally specify one or both of these:
193 # l result is laundered, tree is same as before minus d/patches
194 # t tree is exactly same as before
196 # f result is ff from previous HEAD