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
64 t-git-debrebase $subcmd
65 t-git-debrebase --noop-ok $subcmd
68 t-expect-fail "$checkletters" \
69 t-git-debrebase $subcmd
73 t-git-debrebase $subcmd
77 peel=peel-$subcmd-$startbranch
79 t-clean-on-branch $peel
81 : "---------- $subcmd $startbranch $checkletters ----------"
83 while [ "x$checkletters" != x ]; do
84 : "---- $subcmd $startbranch ...$checkletters ----"
85 make_check "$checkletters"
86 checkletters="${checkletters#?}"
93 checkletters="${checkletters#?}"
100 t-refs-same refs/heads/$before refs/heads/$work
104 t-refs-same refs/heads/$before refs/ffq-prev/heads/$work
108 t-git-get-ref refs/ffq-prev/heads/$work
109 t-refs-notexist refs/debrebase-last/heads/$work
113 t-refs-same refs/ffq-prev/heads/$work \
114 refs/ffq-prev/heads/$startbranch
115 t-refs-notexist refs/debrebase-last/heads/$work
118 t-refs-notexist refs/ffq-prev/heads/$work
120 t-refs-same refs/debrebase-last/heads/$work \
121 refs/debrebase-last/heads/$startbranch
122 t-has-ancestor HEAD refs/debrebase-last/heads/$work
125 t-refs-notexist refs/ffq-prev/heads/$work
126 t-refs-same-start refs/debrebase-last/heads/$work
128 git diff --quiet HEAD^1
129 git diff HEAD^2 | grep $startbranch
130 git reset --hard HEAD^1
133 t-dgit -wgf --quilt=check quilt-fixup
134 git diff HEAD~ debian/patches | egrep .
135 git diff --quiet HEAD~ -- ':.' ':!debian/patches'
136 git reset --hard HEAD~
139 git diff --quiet HEAD refs/heads/$before -- ':.' ':!debian/patches'
143 git diff --quiet HEAD refs/heads/$before
146 t-has-ancestor HEAD refs/heads/$before
151 Ec="F:No ongoing git-debrebase session"
154 # stitched? st'd st'd unst'd unst'd
155 # laundered? laund'd mixed laund'd mixed
157 # "mixed" means an out of order branch
158 # containing mixed commits and patch additions,
159 # but which needs even more patches
161 subcmd '' Ult Ull Vlt Vl
162 subcmd stitch Ns Nu Sltf Stf
163 #subcmd pre-push Ns Nu Sltf Stf
164 subcmd quick ns Sl Sltf Sl
165 subcmd conclude "$Ec" "$Ec" Sltf Sl
166 #subcmd make-patches sPft sPft uPft uPft
167 #subcmd dgit-upload-hook Psft Psft SPft SPft
169 # result codes, each one is a check:
170 # E:$pat } this is an error (must come first)
171 # F:$pat } arg is passed to expect-fail
173 # N this is a noop, error unless --noop-ok
174 # n this is a silent noop
175 # both of these imply tf; but, specify also one of u s
177 # should normally specify one of these:
178 # U just unstiched: ffq-prev is exactly previous HEAD; implies u
179 # u result is unstitched
180 # V ffq-prev remains unchanged; implies also u
181 # s result is stitched, debrebase-last exists and is unchanged
182 # S result is stitch just made, remaining letters apply to result~
184 # P result is add-patches, remaining letters apply to result~
186 # should normally specify one or both of these:
187 # l result is laundered, tree is same as before minus d/patches
188 # t tree is exactly same as before
190 # f result is ff from previous HEAD