3 0ebf8283 2019-07-24 stsp # Copyright (c) 2019 Stefan Sperling <stsp@openbsd.org>
5 0ebf8283 2019-07-24 stsp # Permission to use, copy, modify, and distribute this software for any
6 0ebf8283 2019-07-24 stsp # purpose with or without fee is hereby granted, provided that the above
7 0ebf8283 2019-07-24 stsp # copyright notice and this permission notice appear in all copies.
9 0ebf8283 2019-07-24 stsp # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 0ebf8283 2019-07-24 stsp # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 0ebf8283 2019-07-24 stsp # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 0ebf8283 2019-07-24 stsp # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 0ebf8283 2019-07-24 stsp # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 0ebf8283 2019-07-24 stsp # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 0ebf8283 2019-07-24 stsp # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 0ebf8283 2019-07-24 stsp . ./common.sh
19 f6cae3ed 2020-09-13 naddy test_histedit_no_op() {
20 0ebf8283 2019-07-24 stsp local testroot=`test_init histedit_no_op`
22 0ebf8283 2019-07-24 stsp local orig_commit=`git_show_head $testroot/repo`
23 e600f124 2021-03-21 stsp local orig_author_time=`git_show_author_time $testroot/repo`
25 0ebf8283 2019-07-24 stsp echo "modified alpha on master" > $testroot/repo/alpha
26 0ebf8283 2019-07-24 stsp (cd $testroot/repo && git rm -q beta)
27 0ebf8283 2019-07-24 stsp echo "new file on master" > $testroot/repo/epsilon/new
28 0ebf8283 2019-07-24 stsp (cd $testroot/repo && git add epsilon/new)
29 0ebf8283 2019-07-24 stsp git_commit $testroot/repo -m "committing changes"
30 0ebf8283 2019-07-24 stsp local old_commit1=`git_show_head $testroot/repo`
31 ad324bf5 2021-09-21 stsp local old_author_time1=`git_show_author_time $testroot/repo`
33 0ebf8283 2019-07-24 stsp echo "modified zeta on master" > $testroot/repo/epsilon/zeta
34 0ebf8283 2019-07-24 stsp git_commit $testroot/repo -m "committing to zeta on master"
35 0ebf8283 2019-07-24 stsp local old_commit2=`git_show_head $testroot/repo`
36 e600f124 2021-03-21 stsp local old_author_time2=`git_show_author_time $testroot/repo`
38 86ac67ee 2019-07-25 stsp got diff -r $testroot/repo $orig_commit $old_commit2 \
39 86ac67ee 2019-07-25 stsp > $testroot/diff.expected
41 0ebf8283 2019-07-24 stsp got checkout -c $orig_commit $testroot/repo $testroot/wt > /dev/null
43 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
44 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
48 0ebf8283 2019-07-24 stsp echo "pick $old_commit1" > $testroot/histedit-script
49 0ebf8283 2019-07-24 stsp echo "pick $old_commit2" >> $testroot/histedit-script
51 0ebf8283 2019-07-24 stsp (cd $testroot/wt && got histedit -F $testroot/histedit-script \
52 0ebf8283 2019-07-24 stsp > $testroot/stdout)
54 0ebf8283 2019-07-24 stsp local new_commit1=`git_show_parent_commit $testroot/repo`
55 0ebf8283 2019-07-24 stsp local new_commit2=`git_show_head $testroot/repo`
56 e600f124 2021-03-21 stsp local new_author_time2=`git_show_author_time $testroot/repo`
58 0ebf8283 2019-07-24 stsp local short_old_commit1=`trim_obj_id 28 $old_commit1`
59 0ebf8283 2019-07-24 stsp local short_old_commit2=`trim_obj_id 28 $old_commit2`
60 0ebf8283 2019-07-24 stsp local short_new_commit1=`trim_obj_id 28 $new_commit1`
61 0ebf8283 2019-07-24 stsp local short_new_commit2=`trim_obj_id 28 $new_commit2`
63 0ebf8283 2019-07-24 stsp echo "G alpha" > $testroot/stdout.expected
64 0ebf8283 2019-07-24 stsp echo "D beta" >> $testroot/stdout.expected
65 0ebf8283 2019-07-24 stsp echo "A epsilon/new" >> $testroot/stdout.expected
66 0ebf8283 2019-07-24 stsp echo "$short_old_commit1 -> $short_new_commit1: committing changes" \
67 0ebf8283 2019-07-24 stsp >> $testroot/stdout.expected
68 0ebf8283 2019-07-24 stsp echo "G epsilon/zeta" >> $testroot/stdout.expected
69 0ebf8283 2019-07-24 stsp echo -n "$short_old_commit2 -> $short_new_commit2: " \
70 0ebf8283 2019-07-24 stsp >> $testroot/stdout.expected
71 0ebf8283 2019-07-24 stsp echo "committing to zeta on master" >> $testroot/stdout.expected
72 0ebf8283 2019-07-24 stsp echo "Switching work tree to refs/heads/master" \
73 0ebf8283 2019-07-24 stsp >> $testroot/stdout.expected
75 0ebf8283 2019-07-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
77 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
78 0ebf8283 2019-07-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
79 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
83 0ebf8283 2019-07-24 stsp echo "modified alpha on master" > $testroot/content.expected
84 0ebf8283 2019-07-24 stsp cat $testroot/wt/alpha > $testroot/content
85 0ebf8283 2019-07-24 stsp cmp -s $testroot/content.expected $testroot/content
87 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
88 0ebf8283 2019-07-24 stsp diff -u $testroot/content.expected $testroot/content
89 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
93 0ebf8283 2019-07-24 stsp if [ -e $testroot/wt/beta ]; then
94 0ebf8283 2019-07-24 stsp echo "removed file beta still exists on disk" >&2
95 0ebf8283 2019-07-24 stsp test_done "$testroot" "1"
99 0ebf8283 2019-07-24 stsp echo "new file on master" > $testroot/content.expected
100 0ebf8283 2019-07-24 stsp cat $testroot/wt/epsilon/new > $testroot/content
101 0ebf8283 2019-07-24 stsp cmp -s $testroot/content.expected $testroot/content
103 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
104 0ebf8283 2019-07-24 stsp diff -u $testroot/content.expected $testroot/content
105 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
109 0ebf8283 2019-07-24 stsp (cd $testroot/wt && got status > $testroot/stdout)
111 0ebf8283 2019-07-24 stsp echo -n > $testroot/stdout.expected
112 0ebf8283 2019-07-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
114 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
115 0ebf8283 2019-07-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
116 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
120 0ebf8283 2019-07-24 stsp (cd $testroot/wt && got log -l3 | grep ^commit > $testroot/stdout)
121 0ebf8283 2019-07-24 stsp echo "commit $new_commit2 (master)" > $testroot/stdout.expected
122 0ebf8283 2019-07-24 stsp echo "commit $new_commit1" >> $testroot/stdout.expected
123 0ebf8283 2019-07-24 stsp echo "commit $orig_commit" >> $testroot/stdout.expected
124 0ebf8283 2019-07-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
126 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
127 0ebf8283 2019-07-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
128 86ac67ee 2019-07-25 stsp test_done "$testroot" "$ret"
132 86ac67ee 2019-07-25 stsp got diff -r $testroot/repo $orig_commit $new_commit2 \
133 86ac67ee 2019-07-25 stsp > $testroot/diff
134 86ac67ee 2019-07-25 stsp sed -i -e "s/$old_commit2/$new_commit2/" $testroot/diff.expected
135 86ac67ee 2019-07-25 stsp cmp -s $testroot/diff.expected $testroot/diff
137 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
138 86ac67ee 2019-07-25 stsp diff -u $testroot/diff.expected $testroot/diff
139 a615e0e7 2020-12-16 stsp test_done "$testroot" "$ret"
143 a615e0e7 2020-12-16 stsp (cd $testroot/wt && got update > $testroot/stdout)
145 a615e0e7 2020-12-16 stsp echo 'Already up-to-date' > $testroot/stdout.expected
146 e600f124 2021-03-21 stsp cmp -s $testroot/stdout.expected $testroot/stdout
148 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
149 e600f124 2021-03-21 stsp diff -u $testroot/stdout.expected $testroot/stdout
150 e600f124 2021-03-21 stsp test_done "$testroot" "$ret"
154 e600f124 2021-03-21 stsp # We should have a backup of old commits
155 e600f124 2021-03-21 stsp (cd $testroot/repo && got histedit -l > $testroot/stdout)
156 ad324bf5 2021-09-21 stsp d_orig1=`date -u -r $old_author_time1 +"%G-%m-%d"`
157 3a6b8760 2021-08-31 naddy d_orig2=`date -u -r $old_author_time2 +"%a %b %e %X %Y UTC"`
158 3a6b8760 2021-08-31 naddy d_new2=`date -u -r $new_author_time2 +"%G-%m-%d"`
159 3a6b8760 2021-08-31 naddy d_orig=`date -u -r $orig_author_time +"%G-%m-%d"`
160 e600f124 2021-03-21 stsp cat > $testroot/stdout.expected <<EOF
161 e600f124 2021-03-21 stsp -----------------------------------------------
162 e600f124 2021-03-21 stsp commit $old_commit2 (formerly master)
163 e600f124 2021-03-21 stsp from: $GOT_AUTHOR
164 e600f124 2021-03-21 stsp date: $d_orig2
166 e600f124 2021-03-21 stsp committing to zeta on master
168 e600f124 2021-03-21 stsp has become commit $new_commit2 (master)
169 e600f124 2021-03-21 stsp $d_new2 $GOT_AUTHOR_11 committing to zeta on master
172 ad324bf5 2021-09-21 stsp local is_forked=true d_fork fork_commit fork_commit_msg
174 ad324bf5 2021-09-21 stsp if [ "$old_commit1" = "$new_commit1" ]; then
175 ad324bf5 2021-09-21 stsp if [ "$old_commit2" = "$new_commit2" ]; then
176 ad324bf5 2021-09-21 stsp is_forked=false
178 ad324bf5 2021-09-21 stsp d_fork=$d_orig1
179 ad324bf5 2021-09-21 stsp fork_commit=$new_commit1
180 ad324bf5 2021-09-21 stsp fork_commit_msg="committing changes"
183 ad324bf5 2021-09-21 stsp d_fork=$d_orig
184 ad324bf5 2021-09-21 stsp fork_commit=$orig_commit
185 ad324bf5 2021-09-21 stsp fork_commit_msg="adding the test tree"
188 ad324bf5 2021-09-21 stsp $is_forked && cat >> $testroot/stdout.expected <<EOF
189 ad324bf5 2021-09-21 stsp history forked at $fork_commit
190 ad324bf5 2021-09-21 stsp $d_fork $GOT_AUTHOR_11 $fork_commit_msg
193 a615e0e7 2020-12-16 stsp cmp -s $testroot/stdout.expected $testroot/stdout
195 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
196 a615e0e7 2020-12-16 stsp diff -u $testroot/stdout.expected $testroot/stdout
197 643b85bc 2021-07-16 stsp test_done "$testroot" "$ret"
201 643b85bc 2021-07-16 stsp (cd $testroot/repo && got histedit -X master \
202 643b85bc 2021-07-16 stsp > $testroot/stdout 2> $testroot/stderr)
203 643b85bc 2021-07-16 stsp echo -n "Deleted refs/got/backup/histedit/master/$new_commit2: " \
204 643b85bc 2021-07-16 stsp > $testroot/stdout.expected
205 643b85bc 2021-07-16 stsp echo "$old_commit2" >> $testroot/stdout.expected
206 643b85bc 2021-07-16 stsp echo -n > $testroot/stderr.expected
207 643b85bc 2021-07-16 stsp cmp -s $testroot/stdout.expected $testroot/stdout
209 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
210 643b85bc 2021-07-16 stsp diff -u $testroot/stdout.expected $testroot/stdout
211 643b85bc 2021-07-16 stsp test_done "$testroot" "$ret"
214 643b85bc 2021-07-16 stsp cmp -s $testroot/stderr.expected $testroot/stderr
216 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
217 643b85bc 2021-07-16 stsp diff -u $testroot/stderr.expected $testroot/stderr
218 643b85bc 2021-07-16 stsp test_done "$testroot" "$ret"
222 643b85bc 2021-07-16 stsp (cd $testroot/repo && got histedit -l > $testroot/stdout)
223 643b85bc 2021-07-16 stsp echo -n > $testroot/stdout.expected
224 643b85bc 2021-07-16 stsp cmp -s $testroot/stdout.expected $testroot/stdout
226 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
227 643b85bc 2021-07-16 stsp diff -u $testroot/stdout.expected $testroot/stdout
229 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
232 f6cae3ed 2020-09-13 naddy test_histedit_swap() {
233 0ebf8283 2019-07-24 stsp local testroot=`test_init histedit_swap`
235 0ebf8283 2019-07-24 stsp local orig_commit=`git_show_head $testroot/repo`
237 0ebf8283 2019-07-24 stsp echo "modified alpha on master" > $testroot/repo/alpha
238 0ebf8283 2019-07-24 stsp (cd $testroot/repo && git rm -q beta)
239 0ebf8283 2019-07-24 stsp echo "new file on master" > $testroot/repo/epsilon/new
240 0ebf8283 2019-07-24 stsp (cd $testroot/repo && git add epsilon/new)
241 0ebf8283 2019-07-24 stsp git_commit $testroot/repo -m "committing changes"
242 0ebf8283 2019-07-24 stsp local old_commit1=`git_show_head $testroot/repo`
244 0ebf8283 2019-07-24 stsp echo "modified zeta on master" > $testroot/repo/epsilon/zeta
245 0ebf8283 2019-07-24 stsp git_commit $testroot/repo -m "committing to zeta on master"
246 0ebf8283 2019-07-24 stsp local old_commit2=`git_show_head $testroot/repo`
248 86ac67ee 2019-07-25 stsp got diff -r $testroot/repo $orig_commit $old_commit2 \
249 86ac67ee 2019-07-25 stsp > $testroot/diff.expected
251 0ebf8283 2019-07-24 stsp got checkout -c $orig_commit $testroot/repo $testroot/wt > /dev/null
253 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
254 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
258 0ebf8283 2019-07-24 stsp echo "pick $old_commit2" > $testroot/histedit-script
259 0ebf8283 2019-07-24 stsp echo "pick $old_commit1" >> $testroot/histedit-script
261 0ebf8283 2019-07-24 stsp (cd $testroot/wt && got histedit -F $testroot/histedit-script \
262 0ebf8283 2019-07-24 stsp > $testroot/stdout)
264 0ebf8283 2019-07-24 stsp local new_commit2=`git_show_parent_commit $testroot/repo`
265 0ebf8283 2019-07-24 stsp local new_commit1=`git_show_head $testroot/repo`
267 0ebf8283 2019-07-24 stsp local short_old_commit1=`trim_obj_id 28 $old_commit1`
268 0ebf8283 2019-07-24 stsp local short_old_commit2=`trim_obj_id 28 $old_commit2`
269 0ebf8283 2019-07-24 stsp local short_new_commit1=`trim_obj_id 28 $new_commit1`
270 0ebf8283 2019-07-24 stsp local short_new_commit2=`trim_obj_id 28 $new_commit2`
272 0ebf8283 2019-07-24 stsp echo "G epsilon/zeta" > $testroot/stdout.expected
273 0ebf8283 2019-07-24 stsp echo -n "$short_old_commit2 -> $short_new_commit2: " \
274 0ebf8283 2019-07-24 stsp >> $testroot/stdout.expected
275 0ebf8283 2019-07-24 stsp echo "committing to zeta on master" >> $testroot/stdout.expected
276 0ebf8283 2019-07-24 stsp echo "G alpha" >> $testroot/stdout.expected
277 0ebf8283 2019-07-24 stsp echo "D beta" >> $testroot/stdout.expected
278 0ebf8283 2019-07-24 stsp echo "A epsilon/new" >> $testroot/stdout.expected
279 0ebf8283 2019-07-24 stsp echo "$short_old_commit1 -> $short_new_commit1: committing changes" \
280 0ebf8283 2019-07-24 stsp >> $testroot/stdout.expected
281 0ebf8283 2019-07-24 stsp echo "Switching work tree to refs/heads/master" \
282 0ebf8283 2019-07-24 stsp >> $testroot/stdout.expected
284 0ebf8283 2019-07-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
286 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
287 0ebf8283 2019-07-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
288 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
292 0ebf8283 2019-07-24 stsp echo "modified alpha on master" > $testroot/content.expected
293 0ebf8283 2019-07-24 stsp cat $testroot/wt/alpha > $testroot/content
294 0ebf8283 2019-07-24 stsp cmp -s $testroot/content.expected $testroot/content
296 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
297 0ebf8283 2019-07-24 stsp diff -u $testroot/content.expected $testroot/content
298 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
302 0ebf8283 2019-07-24 stsp if [ -e $testroot/wt/beta ]; then
303 0ebf8283 2019-07-24 stsp echo "removed file beta still exists on disk" >&2
304 0ebf8283 2019-07-24 stsp test_done "$testroot" "1"
308 0ebf8283 2019-07-24 stsp echo "new file on master" > $testroot/content.expected
309 0ebf8283 2019-07-24 stsp cat $testroot/wt/epsilon/new > $testroot/content
310 0ebf8283 2019-07-24 stsp cmp -s $testroot/content.expected $testroot/content
312 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
313 0ebf8283 2019-07-24 stsp diff -u $testroot/content.expected $testroot/content
314 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
318 0ebf8283 2019-07-24 stsp (cd $testroot/wt && got status > $testroot/stdout)
320 0ebf8283 2019-07-24 stsp echo -n > $testroot/stdout.expected
321 0ebf8283 2019-07-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
323 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
324 0ebf8283 2019-07-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
325 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
329 0ebf8283 2019-07-24 stsp (cd $testroot/wt && got log -l3 | grep ^commit > $testroot/stdout)
330 0ebf8283 2019-07-24 stsp echo "commit $new_commit1 (master)" > $testroot/stdout.expected
331 0ebf8283 2019-07-24 stsp echo "commit $new_commit2" >> $testroot/stdout.expected
332 0ebf8283 2019-07-24 stsp echo "commit $orig_commit" >> $testroot/stdout.expected
333 0ebf8283 2019-07-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
335 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
336 0ebf8283 2019-07-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
337 86ac67ee 2019-07-25 stsp test_done "$testroot" "$ret"
341 86ac67ee 2019-07-25 stsp got diff -r $testroot/repo $orig_commit $new_commit1 \
342 86ac67ee 2019-07-25 stsp > $testroot/diff
343 86ac67ee 2019-07-25 stsp sed -i -e "s/$old_commit2/$new_commit1/" $testroot/diff.expected
344 86ac67ee 2019-07-25 stsp cmp -s $testroot/diff.expected $testroot/diff
346 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
347 86ac67ee 2019-07-25 stsp diff -u $testroot/diff.expected $testroot/diff
349 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
352 f6cae3ed 2020-09-13 naddy test_histedit_drop() {
353 0ebf8283 2019-07-24 stsp local testroot=`test_init histedit_drop`
354 0ebf8283 2019-07-24 stsp local orig_commit=`git_show_head $testroot/repo`
356 0ebf8283 2019-07-24 stsp echo "modified alpha on master" > $testroot/repo/alpha
357 0ebf8283 2019-07-24 stsp (cd $testroot/repo && git rm -q beta)
358 0ebf8283 2019-07-24 stsp echo "new file on master" > $testroot/repo/epsilon/new
359 0ebf8283 2019-07-24 stsp (cd $testroot/repo && git add epsilon/new)
360 0ebf8283 2019-07-24 stsp git_commit $testroot/repo -m "committing changes"
361 0ebf8283 2019-07-24 stsp local old_commit1=`git_show_head $testroot/repo`
363 0ebf8283 2019-07-24 stsp echo "modified zeta on master" > $testroot/repo/epsilon/zeta
364 0ebf8283 2019-07-24 stsp git_commit $testroot/repo -m "committing to zeta on master"
365 0ebf8283 2019-07-24 stsp local old_commit2=`git_show_head $testroot/repo`
367 86ac67ee 2019-07-25 stsp got diff -r $testroot/repo $old_commit1 $old_commit2 \
368 86ac67ee 2019-07-25 stsp > $testroot/diff.expected
370 0ebf8283 2019-07-24 stsp got checkout -c $orig_commit $testroot/repo $testroot/wt > /dev/null
372 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
373 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
377 0ebf8283 2019-07-24 stsp echo "drop $old_commit1" > $testroot/histedit-script
378 0ebf8283 2019-07-24 stsp echo "pick $old_commit2" >> $testroot/histedit-script
380 0ebf8283 2019-07-24 stsp (cd $testroot/wt && got histedit -F $testroot/histedit-script \
381 0ebf8283 2019-07-24 stsp > $testroot/stdout)
383 0ebf8283 2019-07-24 stsp local new_commit2=`git_show_head $testroot/repo`
385 0ebf8283 2019-07-24 stsp local short_old_commit1=`trim_obj_id 28 $old_commit1`
386 0ebf8283 2019-07-24 stsp local short_old_commit2=`trim_obj_id 28 $old_commit2`
387 0ebf8283 2019-07-24 stsp local short_new_commit2=`trim_obj_id 28 $new_commit2`
389 0ebf8283 2019-07-24 stsp echo "$short_old_commit1 -> drop commit: committing changes" \
390 0ebf8283 2019-07-24 stsp > $testroot/stdout.expected
391 0ebf8283 2019-07-24 stsp echo "G epsilon/zeta" >> $testroot/stdout.expected
392 0ebf8283 2019-07-24 stsp echo -n "$short_old_commit2 -> $short_new_commit2: " \
393 0ebf8283 2019-07-24 stsp >> $testroot/stdout.expected
394 0ebf8283 2019-07-24 stsp echo "committing to zeta on master" >> $testroot/stdout.expected
395 0ebf8283 2019-07-24 stsp echo "Switching work tree to refs/heads/master" \
396 0ebf8283 2019-07-24 stsp >> $testroot/stdout.expected
398 0ebf8283 2019-07-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
400 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
401 0ebf8283 2019-07-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
402 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
406 0ebf8283 2019-07-24 stsp for f in alpha beta; do
407 0ebf8283 2019-07-24 stsp echo "$f" > $testroot/content.expected
408 0ebf8283 2019-07-24 stsp cat $testroot/wt/$f > $testroot/content
409 0ebf8283 2019-07-24 stsp cmp -s $testroot/content.expected $testroot/content
411 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
412 0ebf8283 2019-07-24 stsp diff -u $testroot/content.expected $testroot/content
413 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
418 0ebf8283 2019-07-24 stsp if [ -e $testroot/wt/new ]; then
419 0ebf8283 2019-07-24 stsp echo "file new exists on disk but should not" >&2
420 0ebf8283 2019-07-24 stsp test_done "$testroot" "1"
424 0ebf8283 2019-07-24 stsp (cd $testroot/wt && got status > $testroot/stdout)
426 0ebf8283 2019-07-24 stsp echo -n > $testroot/stdout.expected
427 0ebf8283 2019-07-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
429 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
430 0ebf8283 2019-07-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
431 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
435 0ebf8283 2019-07-24 stsp (cd $testroot/wt && got log -l3 | grep ^commit > $testroot/stdout)
436 0ebf8283 2019-07-24 stsp echo "commit $new_commit2 (master)" > $testroot/stdout.expected
437 0ebf8283 2019-07-24 stsp echo "commit $orig_commit" >> $testroot/stdout.expected
438 0ebf8283 2019-07-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
440 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
441 0ebf8283 2019-07-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
442 86ac67ee 2019-07-25 stsp test_done "$testroot" "$ret"
446 86ac67ee 2019-07-25 stsp got diff -r $testroot/repo $orig_commit $new_commit2 \
447 86ac67ee 2019-07-25 stsp > $testroot/diff
448 86ac67ee 2019-07-25 stsp sed -i -e "s/$old_commit1/$orig_commit/" $testroot/diff.expected
449 86ac67ee 2019-07-25 stsp sed -i -e "s/$old_commit2/$new_commit2/" $testroot/diff.expected
450 86ac67ee 2019-07-25 stsp cmp -s $testroot/diff.expected $testroot/diff
452 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
453 86ac67ee 2019-07-25 stsp diff -u $testroot/diff.expected $testroot/diff
455 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
458 f6cae3ed 2020-09-13 naddy test_histedit_fold() {
459 0ebf8283 2019-07-24 stsp local testroot=`test_init histedit_fold`
461 0ebf8283 2019-07-24 stsp local orig_commit=`git_show_head $testroot/repo`
463 0ebf8283 2019-07-24 stsp echo "modified alpha on master" > $testroot/repo/alpha
464 0ebf8283 2019-07-24 stsp (cd $testroot/repo && git rm -q beta)
465 0ebf8283 2019-07-24 stsp echo "new file on master" > $testroot/repo/epsilon/new
466 0ebf8283 2019-07-24 stsp (cd $testroot/repo && git add epsilon/new)
467 0ebf8283 2019-07-24 stsp git_commit $testroot/repo -m "committing changes"
468 0ebf8283 2019-07-24 stsp local old_commit1=`git_show_head $testroot/repo`
470 0ebf8283 2019-07-24 stsp echo "modified zeta on master" > $testroot/repo/epsilon/zeta
471 0ebf8283 2019-07-24 stsp git_commit $testroot/repo -m "committing to zeta on master"
472 0ebf8283 2019-07-24 stsp local old_commit2=`git_show_head $testroot/repo`
474 3f9de99f 2019-07-24 stsp echo "modified delta on master" > $testroot/repo/gamma/delta
475 3f9de99f 2019-07-24 stsp git_commit $testroot/repo -m "committing to delta on master"
476 3f9de99f 2019-07-24 stsp local old_commit3=`git_show_head $testroot/repo`
478 0ebf8283 2019-07-24 stsp got checkout -c $orig_commit $testroot/repo $testroot/wt > /dev/null
480 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
481 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
485 0ebf8283 2019-07-24 stsp echo "fold $old_commit1" > $testroot/histedit-script
486 3f9de99f 2019-07-24 stsp echo "drop $old_commit2" >> $testroot/histedit-script
487 3f9de99f 2019-07-24 stsp echo "pick $old_commit3" >> $testroot/histedit-script
488 0ebf8283 2019-07-24 stsp echo "mesg committing folded changes" >> $testroot/histedit-script
490 0ebf8283 2019-07-24 stsp (cd $testroot/wt && got histedit -F $testroot/histedit-script \
491 0ebf8283 2019-07-24 stsp > $testroot/stdout)
493 0ebf8283 2019-07-24 stsp local new_commit1=`git_show_parent_commit $testroot/repo`
494 0ebf8283 2019-07-24 stsp local new_commit2=`git_show_head $testroot/repo`
496 0ebf8283 2019-07-24 stsp local short_old_commit1=`trim_obj_id 28 $old_commit1`
497 0ebf8283 2019-07-24 stsp local short_old_commit2=`trim_obj_id 28 $old_commit2`
498 3f9de99f 2019-07-24 stsp local short_old_commit3=`trim_obj_id 28 $old_commit3`
499 0ebf8283 2019-07-24 stsp local short_new_commit1=`trim_obj_id 28 $new_commit1`
500 0ebf8283 2019-07-24 stsp local short_new_commit2=`trim_obj_id 28 $new_commit2`
502 0ebf8283 2019-07-24 stsp echo "G alpha" > $testroot/stdout.expected
503 0ebf8283 2019-07-24 stsp echo "D beta" >> $testroot/stdout.expected
504 0ebf8283 2019-07-24 stsp echo "A epsilon/new" >> $testroot/stdout.expected
505 0ebf8283 2019-07-24 stsp echo "$short_old_commit1 -> fold commit: committing changes" \
506 0ebf8283 2019-07-24 stsp >> $testroot/stdout.expected
507 3f9de99f 2019-07-24 stsp echo -n "$short_old_commit2 -> " >> $testroot/stdout.expected
508 3f9de99f 2019-07-24 stsp echo "drop commit: committing to zeta on master" \
509 0ebf8283 2019-07-24 stsp >> $testroot/stdout.expected
510 3f9de99f 2019-07-24 stsp echo "G gamma/delta" >> $testroot/stdout.expected
511 3f9de99f 2019-07-24 stsp echo -n "$short_old_commit3 -> $short_new_commit2: " \
512 3f9de99f 2019-07-24 stsp >> $testroot/stdout.expected
513 0ebf8283 2019-07-24 stsp echo "committing folded changes" >> $testroot/stdout.expected
514 0ebf8283 2019-07-24 stsp echo "Switching work tree to refs/heads/master" \
515 0ebf8283 2019-07-24 stsp >> $testroot/stdout.expected
517 0ebf8283 2019-07-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
519 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
520 0ebf8283 2019-07-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
521 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
525 0ebf8283 2019-07-24 stsp echo "modified alpha on master" > $testroot/content.expected
526 0ebf8283 2019-07-24 stsp cat $testroot/wt/alpha > $testroot/content
527 0ebf8283 2019-07-24 stsp cmp -s $testroot/content.expected $testroot/content
529 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
530 0ebf8283 2019-07-24 stsp diff -u $testroot/content.expected $testroot/content
531 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
535 0ebf8283 2019-07-24 stsp if [ -e $testroot/wt/beta ]; then
536 0ebf8283 2019-07-24 stsp echo "removed file beta still exists on disk" >&2
537 0ebf8283 2019-07-24 stsp test_done "$testroot" "1"
541 0ebf8283 2019-07-24 stsp echo "new file on master" > $testroot/content.expected
542 0ebf8283 2019-07-24 stsp cat $testroot/wt/epsilon/new > $testroot/content
543 0ebf8283 2019-07-24 stsp cmp -s $testroot/content.expected $testroot/content
545 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
546 0ebf8283 2019-07-24 stsp diff -u $testroot/content.expected $testroot/content
547 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
551 0ebf8283 2019-07-24 stsp (cd $testroot/wt && got status > $testroot/stdout)
553 0ebf8283 2019-07-24 stsp echo -n > $testroot/stdout.expected
554 0ebf8283 2019-07-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
556 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
557 0ebf8283 2019-07-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
558 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
562 0ebf8283 2019-07-24 stsp (cd $testroot/wt && got log -l3 | grep ^commit > $testroot/stdout)
563 0ebf8283 2019-07-24 stsp echo "commit $new_commit2 (master)" > $testroot/stdout.expected
564 0ebf8283 2019-07-24 stsp echo "commit $orig_commit" >> $testroot/stdout.expected
565 0ebf8283 2019-07-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
567 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
568 0ebf8283 2019-07-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
570 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
573 f6cae3ed 2020-09-13 naddy test_histedit_edit() {
574 0ebf8283 2019-07-24 stsp local testroot=`test_init histedit_edit`
576 0ebf8283 2019-07-24 stsp local orig_commit=`git_show_head $testroot/repo`
578 0ebf8283 2019-07-24 stsp echo "modified alpha on master" > $testroot/repo/alpha
579 0ebf8283 2019-07-24 stsp (cd $testroot/repo && git rm -q beta)
580 0ebf8283 2019-07-24 stsp echo "new file on master" > $testroot/repo/epsilon/new
581 0ebf8283 2019-07-24 stsp (cd $testroot/repo && git add epsilon/new)
582 0ebf8283 2019-07-24 stsp git_commit $testroot/repo -m "committing changes"
583 0ebf8283 2019-07-24 stsp local old_commit1=`git_show_head $testroot/repo`
585 0ebf8283 2019-07-24 stsp echo "modified zeta on master" > $testroot/repo/epsilon/zeta
586 0ebf8283 2019-07-24 stsp git_commit $testroot/repo -m "committing to zeta on master"
587 0ebf8283 2019-07-24 stsp local old_commit2=`git_show_head $testroot/repo`
589 0ebf8283 2019-07-24 stsp got checkout -c $orig_commit $testroot/repo $testroot/wt > /dev/null
591 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
592 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
596 0ebf8283 2019-07-24 stsp echo "edit $old_commit1" > $testroot/histedit-script
597 0ebf8283 2019-07-24 stsp echo "mesg committing changes" >> $testroot/histedit-script
598 0ebf8283 2019-07-24 stsp echo "pick $old_commit2" >> $testroot/histedit-script
600 0ebf8283 2019-07-24 stsp (cd $testroot/wt && got histedit -F $testroot/histedit-script \
601 0ebf8283 2019-07-24 stsp > $testroot/stdout)
603 0ebf8283 2019-07-24 stsp local short_old_commit1=`trim_obj_id 28 $old_commit1`
604 0ebf8283 2019-07-24 stsp local short_old_commit2=`trim_obj_id 28 $old_commit2`
606 0ebf8283 2019-07-24 stsp echo "G alpha" > $testroot/stdout.expected
607 0ebf8283 2019-07-24 stsp echo "D beta" >> $testroot/stdout.expected
608 0ebf8283 2019-07-24 stsp echo "A epsilon/new" >> $testroot/stdout.expected
609 0ebf8283 2019-07-24 stsp echo "Stopping histedit for amending commit $old_commit1" \
610 0ebf8283 2019-07-24 stsp >> $testroot/stdout.expected
611 0ebf8283 2019-07-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
613 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
614 0ebf8283 2019-07-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
615 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
619 0ebf8283 2019-07-24 stsp echo "edited modified alpha on master" > $testroot/wt/alpha
621 f032f1f7 2019-08-04 stsp # test interaction of 'got stage' and histedit -c
622 f032f1f7 2019-08-04 stsp (cd $testroot/wt && got stage alpha > /dev/null)
623 f032f1f7 2019-08-04 stsp (cd $testroot/wt && got histedit -c > $testroot/stdout \
624 f032f1f7 2019-08-04 stsp 2> $testroot/stderr)
626 49c543a6 2022-03-31 naddy if [ $ret -eq 0 ]; then
627 f032f1f7 2019-08-04 stsp echo "histedit succeeded unexpectedly" >&2
628 f032f1f7 2019-08-04 stsp test_done "$testroot" "1"
631 f032f1f7 2019-08-04 stsp echo -n "got: work tree contains files with staged changes; " \
632 f032f1f7 2019-08-04 stsp > $testroot/stderr.expected
633 f032f1f7 2019-08-04 stsp echo "these changes must be committed or unstaged first" \
634 f032f1f7 2019-08-04 stsp >> $testroot/stderr.expected
635 f032f1f7 2019-08-04 stsp cmp -s $testroot/stderr.expected $testroot/stderr
637 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
638 f032f1f7 2019-08-04 stsp diff -u $testroot/stderr.expected $testroot/stderr
639 f032f1f7 2019-08-04 stsp test_done "$testroot" "$ret"
643 f032f1f7 2019-08-04 stsp (cd $testroot/wt && got unstage alpha > /dev/null)
644 0ebf8283 2019-07-24 stsp (cd $testroot/wt && got histedit -c > $testroot/stdout)
646 0ebf8283 2019-07-24 stsp local new_commit1=`git_show_parent_commit $testroot/repo`
647 0ebf8283 2019-07-24 stsp local new_commit2=`git_show_head $testroot/repo`
649 0ebf8283 2019-07-24 stsp local short_new_commit1=`trim_obj_id 28 $new_commit1`
650 0ebf8283 2019-07-24 stsp local short_new_commit2=`trim_obj_id 28 $new_commit2`
652 0ebf8283 2019-07-24 stsp echo "$short_old_commit1 -> $short_new_commit1: committing changes" \
653 0ebf8283 2019-07-24 stsp > $testroot/stdout.expected
654 0ebf8283 2019-07-24 stsp echo "G epsilon/zeta" >> $testroot/stdout.expected
655 0ebf8283 2019-07-24 stsp echo -n "$short_old_commit2 -> $short_new_commit2: " \
656 0ebf8283 2019-07-24 stsp >> $testroot/stdout.expected
657 0ebf8283 2019-07-24 stsp echo "committing to zeta on master" >> $testroot/stdout.expected
658 0ebf8283 2019-07-24 stsp echo "Switching work tree to refs/heads/master" \
659 0ebf8283 2019-07-24 stsp >> $testroot/stdout.expected
661 0ebf8283 2019-07-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
663 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
664 0ebf8283 2019-07-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
665 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
669 0ebf8283 2019-07-24 stsp echo "edited modified alpha on master" > $testroot/content.expected
670 0ebf8283 2019-07-24 stsp cat $testroot/wt/alpha > $testroot/content
671 0ebf8283 2019-07-24 stsp cmp -s $testroot/content.expected $testroot/content
673 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
674 0ebf8283 2019-07-24 stsp diff -u $testroot/content.expected $testroot/content
675 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
679 0ebf8283 2019-07-24 stsp if [ -e $testroot/wt/beta ]; then
680 0ebf8283 2019-07-24 stsp echo "removed file beta still exists on disk" >&2
681 0ebf8283 2019-07-24 stsp test_done "$testroot" "1"
685 0ebf8283 2019-07-24 stsp echo "new file on master" > $testroot/content.expected
686 0ebf8283 2019-07-24 stsp cat $testroot/wt/epsilon/new > $testroot/content
687 0ebf8283 2019-07-24 stsp cmp -s $testroot/content.expected $testroot/content
689 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
690 0ebf8283 2019-07-24 stsp diff -u $testroot/content.expected $testroot/content
691 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
695 0ebf8283 2019-07-24 stsp (cd $testroot/wt && got status > $testroot/stdout)
697 0ebf8283 2019-07-24 stsp echo -n > $testroot/stdout.expected
698 0ebf8283 2019-07-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
700 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
701 0ebf8283 2019-07-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
702 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
706 0ebf8283 2019-07-24 stsp (cd $testroot/wt && got log -l3 | grep ^commit > $testroot/stdout)
707 0ebf8283 2019-07-24 stsp echo "commit $new_commit2 (master)" > $testroot/stdout.expected
708 0ebf8283 2019-07-24 stsp echo "commit $new_commit1" >> $testroot/stdout.expected
709 0ebf8283 2019-07-24 stsp echo "commit $orig_commit" >> $testroot/stdout.expected
710 0ebf8283 2019-07-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
712 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
713 0ebf8283 2019-07-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
715 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
718 f6cae3ed 2020-09-13 naddy test_histedit_fold_last_commit() {
719 0ebf8283 2019-07-24 stsp local testroot=`test_init histedit_fold_last_commit`
721 0ebf8283 2019-07-24 stsp local orig_commit=`git_show_head $testroot/repo`
723 0ebf8283 2019-07-24 stsp echo "modified alpha on master" > $testroot/repo/alpha
724 0ebf8283 2019-07-24 stsp (cd $testroot/repo && git rm -q beta)
725 0ebf8283 2019-07-24 stsp echo "new file on master" > $testroot/repo/epsilon/new
726 0ebf8283 2019-07-24 stsp (cd $testroot/repo && git add epsilon/new)
727 0ebf8283 2019-07-24 stsp git_commit $testroot/repo -m "committing changes"
728 0ebf8283 2019-07-24 stsp local old_commit1=`git_show_head $testroot/repo`
730 0ebf8283 2019-07-24 stsp echo "modified zeta on master" > $testroot/repo/epsilon/zeta
731 0ebf8283 2019-07-24 stsp git_commit $testroot/repo -m "committing to zeta on master"
732 0ebf8283 2019-07-24 stsp local old_commit2=`git_show_head $testroot/repo`
734 0ebf8283 2019-07-24 stsp got checkout -c $orig_commit $testroot/repo $testroot/wt > /dev/null
736 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
737 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
741 0ebf8283 2019-07-24 stsp echo "pick $old_commit1" > $testroot/histedit-script
742 0ebf8283 2019-07-24 stsp echo "fold $old_commit2" >> $testroot/histedit-script
743 0ebf8283 2019-07-24 stsp echo "mesg committing folded changes" >> $testroot/histedit-script
745 0ebf8283 2019-07-24 stsp (cd $testroot/wt && got histedit -F $testroot/histedit-script \
746 0ebf8283 2019-07-24 stsp > $testroot/stdout 2> $testroot/stderr)
749 49c543a6 2022-03-31 naddy if [ $ret -eq 0 ]; then
750 0ebf8283 2019-07-24 stsp echo "histedit succeeded unexpectedly" >&2
751 0ebf8283 2019-07-24 stsp test_done "$testroot" "1"
755 0ebf8283 2019-07-24 stsp echo "got: last commit in histedit script cannot be folded" \
756 0ebf8283 2019-07-24 stsp > $testroot/stderr.expected
758 0ebf8283 2019-07-24 stsp cmp -s $testroot/stderr.expected $testroot/stderr
760 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
761 0ebf8283 2019-07-24 stsp diff -u $testroot/stderr.expected $testroot/stderr
763 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
766 f6cae3ed 2020-09-13 naddy test_histedit_missing_commit() {
767 0ebf8283 2019-07-24 stsp local testroot=`test_init histedit_missing_commit`
769 0ebf8283 2019-07-24 stsp local orig_commit=`git_show_head $testroot/repo`
771 0ebf8283 2019-07-24 stsp echo "modified alpha on master" > $testroot/repo/alpha
772 0ebf8283 2019-07-24 stsp (cd $testroot/repo && git rm -q beta)
773 0ebf8283 2019-07-24 stsp echo "new file on master" > $testroot/repo/epsilon/new
774 0ebf8283 2019-07-24 stsp (cd $testroot/repo && git add epsilon/new)
775 0ebf8283 2019-07-24 stsp git_commit $testroot/repo -m "committing changes"
776 0ebf8283 2019-07-24 stsp local old_commit1=`git_show_head $testroot/repo`
778 0ebf8283 2019-07-24 stsp echo "modified zeta on master" > $testroot/repo/epsilon/zeta
779 0ebf8283 2019-07-24 stsp git_commit $testroot/repo -m "committing to zeta on master"
780 0ebf8283 2019-07-24 stsp local old_commit2=`git_show_head $testroot/repo`
782 0ebf8283 2019-07-24 stsp got checkout -c $orig_commit $testroot/repo $testroot/wt > /dev/null
784 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
785 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
789 0ebf8283 2019-07-24 stsp echo "pick $old_commit1" > $testroot/histedit-script
790 0ebf8283 2019-07-24 stsp echo "mesg committing changes" >> $testroot/histedit-script
792 0ebf8283 2019-07-24 stsp (cd $testroot/wt && got histedit -F $testroot/histedit-script \
793 0ebf8283 2019-07-24 stsp > $testroot/stdout 2> $testroot/stderr)
796 49c543a6 2022-03-31 naddy if [ $ret -eq 0 ]; then
797 0ebf8283 2019-07-24 stsp echo "histedit succeeded unexpectedly" >&2
798 0ebf8283 2019-07-24 stsp test_done "$testroot" "1"
802 0ebf8283 2019-07-24 stsp echo "got: commit $old_commit2 missing from histedit script" \
803 0ebf8283 2019-07-24 stsp > $testroot/stderr.expected
805 0ebf8283 2019-07-24 stsp cmp -s $testroot/stderr.expected $testroot/stderr
807 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
808 0ebf8283 2019-07-24 stsp diff -u $testroot/stderr.expected $testroot/stderr
810 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
813 f6cae3ed 2020-09-13 naddy test_histedit_abort() {
814 0ebf8283 2019-07-24 stsp local testroot=`test_init histedit_abort`
816 0ebf8283 2019-07-24 stsp local orig_commit=`git_show_head $testroot/repo`
818 0ebf8283 2019-07-24 stsp echo "modified alpha on master" > $testroot/repo/alpha
819 0ebf8283 2019-07-24 stsp (cd $testroot/repo && git rm -q beta)
820 0ebf8283 2019-07-24 stsp echo "new file on master" > $testroot/repo/epsilon/new
821 0ebf8283 2019-07-24 stsp (cd $testroot/repo && git add epsilon/new)
822 0ebf8283 2019-07-24 stsp git_commit $testroot/repo -m "committing changes"
823 0ebf8283 2019-07-24 stsp local old_commit1=`git_show_head $testroot/repo`
825 0ebf8283 2019-07-24 stsp echo "modified zeta on master" > $testroot/repo/epsilon/zeta
826 0ebf8283 2019-07-24 stsp git_commit $testroot/repo -m "committing to zeta on master"
827 0ebf8283 2019-07-24 stsp local old_commit2=`git_show_head $testroot/repo`
829 0ebf8283 2019-07-24 stsp got checkout -c $orig_commit $testroot/repo $testroot/wt > /dev/null
831 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
832 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
836 41f061b2 2021-10-05 stsp # unrelated unversioned file in work tree
837 41f061b2 2021-10-05 stsp touch $testroot/wt/unversioned-file
839 0ebf8283 2019-07-24 stsp echo "edit $old_commit1" > $testroot/histedit-script
840 0ebf8283 2019-07-24 stsp echo "mesg committing changes" >> $testroot/histedit-script
841 0ebf8283 2019-07-24 stsp echo "pick $old_commit2" >> $testroot/histedit-script
843 0ebf8283 2019-07-24 stsp (cd $testroot/wt && got histedit -F $testroot/histedit-script \
844 0ebf8283 2019-07-24 stsp > $testroot/stdout)
846 0ebf8283 2019-07-24 stsp local short_old_commit1=`trim_obj_id 28 $old_commit1`
847 0ebf8283 2019-07-24 stsp local short_old_commit2=`trim_obj_id 28 $old_commit2`
849 0ebf8283 2019-07-24 stsp echo "G alpha" > $testroot/stdout.expected
850 0ebf8283 2019-07-24 stsp echo "D beta" >> $testroot/stdout.expected
851 0ebf8283 2019-07-24 stsp echo "A epsilon/new" >> $testroot/stdout.expected
852 0ebf8283 2019-07-24 stsp echo "Stopping histedit for amending commit $old_commit1" \
853 0ebf8283 2019-07-24 stsp >> $testroot/stdout.expected
854 0ebf8283 2019-07-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
856 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
857 0ebf8283 2019-07-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
858 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
862 0ebf8283 2019-07-24 stsp echo "edited modified alpha on master" > $testroot/wt/alpha
864 0ebf8283 2019-07-24 stsp (cd $testroot/wt && got histedit -a > $testroot/stdout)
866 0ebf8283 2019-07-24 stsp local new_commit1=`git_show_parent_commit $testroot/repo`
867 0ebf8283 2019-07-24 stsp local new_commit2=`git_show_head $testroot/repo`
869 0ebf8283 2019-07-24 stsp echo "Switching work tree to refs/heads/master" \
870 0ebf8283 2019-07-24 stsp > $testroot/stdout.expected
871 0ebf8283 2019-07-24 stsp echo "R alpha" >> $testroot/stdout.expected
872 0ebf8283 2019-07-24 stsp echo "R beta" >> $testroot/stdout.expected
873 0ebf8283 2019-07-24 stsp echo "R epsilon/new" >> $testroot/stdout.expected
874 0ebf8283 2019-07-24 stsp echo "Histedit of refs/heads/master aborted" \
875 0ebf8283 2019-07-24 stsp >> $testroot/stdout.expected
877 0ebf8283 2019-07-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
879 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
880 0ebf8283 2019-07-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
881 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
885 0ebf8283 2019-07-24 stsp for f in alpha beta; do
886 0ebf8283 2019-07-24 stsp echo "$f" > $testroot/content.expected
887 0ebf8283 2019-07-24 stsp cat $testroot/wt/$f > $testroot/content
888 0ebf8283 2019-07-24 stsp cmp -s $testroot/content.expected $testroot/content
890 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
891 0ebf8283 2019-07-24 stsp diff -u $testroot/content.expected $testroot/content
892 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
897 0ebf8283 2019-07-24 stsp echo "new file on master" > $testroot/content.expected
898 0ebf8283 2019-07-24 stsp cat $testroot/wt/epsilon/new > $testroot/content
899 0ebf8283 2019-07-24 stsp cmp -s $testroot/content.expected $testroot/content
901 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
902 0ebf8283 2019-07-24 stsp diff -u $testroot/content.expected $testroot/content
903 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
907 0ebf8283 2019-07-24 stsp (cd $testroot/wt && got status > $testroot/stdout)
909 0ebf8283 2019-07-24 stsp echo "? epsilon/new" > $testroot/stdout.expected
910 41f061b2 2021-10-05 stsp echo "? unversioned-file" >> $testroot/stdout.expected
911 0ebf8283 2019-07-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
913 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
914 0ebf8283 2019-07-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
915 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
919 0ebf8283 2019-07-24 stsp (cd $testroot/wt && got log -l3 | grep ^commit > $testroot/stdout)
920 0ebf8283 2019-07-24 stsp echo "commit $new_commit2 (master)" > $testroot/stdout.expected
921 0ebf8283 2019-07-24 stsp echo "commit $new_commit1" >> $testroot/stdout.expected
922 0ebf8283 2019-07-24 stsp echo "commit $orig_commit" >> $testroot/stdout.expected
923 0160a755 2019-07-25 stsp cmp -s $testroot/stdout.expected $testroot/stdout
925 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
926 0160a755 2019-07-25 stsp diff -u $testroot/stdout.expected $testroot/stdout
928 0160a755 2019-07-25 stsp test_done "$testroot" "$ret"
931 f6cae3ed 2020-09-13 naddy test_histedit_path_prefix_drop() {
932 a4027091 2019-07-25 stsp local testroot=`test_init histedit_path_prefix_drop`
933 0160a755 2019-07-25 stsp local orig_commit=`git_show_head $testroot/repo`
935 0160a755 2019-07-25 stsp echo "modified zeta" > $testroot/repo/epsilon/zeta
936 0160a755 2019-07-25 stsp git_commit $testroot/repo -m "changing zeta"
937 0160a755 2019-07-25 stsp local old_commit1=`git_show_head $testroot/repo`
939 0160a755 2019-07-25 stsp got checkout -c $orig_commit -p gamma $testroot/repo \
940 0160a755 2019-07-25 stsp $testroot/wt > /dev/null
942 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
943 0160a755 2019-07-25 stsp test_done "$testroot" "$ret"
947 0160a755 2019-07-25 stsp echo "drop $old_commit1" > $testroot/histedit-script
949 0160a755 2019-07-25 stsp (cd $testroot/wt && got histedit -F $testroot/histedit-script \
950 0160a755 2019-07-25 stsp > $testroot/stdout 2> $testroot/stderr)
953 49c543a6 2022-03-31 naddy if [ $ret -eq 0 ]; then
954 0160a755 2019-07-25 stsp echo "histedit succeeded unexpectedly" >&2
955 0160a755 2019-07-25 stsp test_done "$testroot" "1"
959 0160a755 2019-07-25 stsp echo -n "got: cannot edit branch history which contains changes " \
960 0160a755 2019-07-25 stsp > $testroot/stderr.expected
961 0160a755 2019-07-25 stsp echo "outside of this work tree's path prefix" \
962 0160a755 2019-07-25 stsp >> $testroot/stderr.expected
964 0160a755 2019-07-25 stsp cmp -s $testroot/stderr.expected $testroot/stderr
966 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
967 0160a755 2019-07-25 stsp diff -u $testroot/stderr.expected $testroot/stderr
968 0160a755 2019-07-25 stsp test_done "$testroot" "$ret"
972 0160a755 2019-07-25 stsp rm -rf $testroot/wt
973 0160a755 2019-07-25 stsp got checkout -c $orig_commit -p epsilon $testroot/repo \
974 0160a755 2019-07-25 stsp $testroot/wt > /dev/null
976 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
977 0160a755 2019-07-25 stsp test_done "$testroot" "$ret"
980 0160a755 2019-07-25 stsp (cd $testroot/wt && got histedit -F $testroot/histedit-script \
981 0160a755 2019-07-25 stsp > $testroot/stdout)
983 0160a755 2019-07-25 stsp local short_old_commit1=`trim_obj_id 28 $old_commit1`
984 0160a755 2019-07-25 stsp local short_old_commit2=`trim_obj_id 28 $old_commit2`
986 0160a755 2019-07-25 stsp echo "$short_old_commit1 -> drop commit: changing zeta" \
987 0160a755 2019-07-25 stsp > $testroot/stdout.expected
988 0160a755 2019-07-25 stsp echo "Switching work tree to refs/heads/master" \
989 0160a755 2019-07-25 stsp >> $testroot/stdout.expected
991 0ebf8283 2019-07-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
993 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
994 0ebf8283 2019-07-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
995 0160a755 2019-07-25 stsp test_done "$testroot" "$ret"
999 0160a755 2019-07-25 stsp echo "zeta" > $testroot/content.expected
1000 0160a755 2019-07-25 stsp cat $testroot/wt/zeta > $testroot/content
1001 0160a755 2019-07-25 stsp cmp -s $testroot/content.expected $testroot/content
1003 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1004 0160a755 2019-07-25 stsp diff -u $testroot/content.expected $testroot/content
1005 0160a755 2019-07-25 stsp test_done "$testroot" "$ret"
1010 0160a755 2019-07-25 stsp (cd $testroot/wt && got status > $testroot/stdout)
1012 0160a755 2019-07-25 stsp echo -n > $testroot/stdout.expected
1013 0160a755 2019-07-25 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1015 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1016 0160a755 2019-07-25 stsp diff -u $testroot/stdout.expected $testroot/stdout
1017 0160a755 2019-07-25 stsp test_done "$testroot" "$ret"
1021 0160a755 2019-07-25 stsp (cd $testroot/wt && got log -l3 | grep ^commit > $testroot/stdout)
1022 0160a755 2019-07-25 stsp echo "commit $orig_commit (master)" > $testroot/stdout.expected
1023 b2c50a0a 2019-07-25 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1025 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1026 b2c50a0a 2019-07-25 stsp diff -u $testroot/stdout.expected $testroot/stdout
1028 b2c50a0a 2019-07-25 stsp test_done "$testroot" "$ret"
1031 f6cae3ed 2020-09-13 naddy test_histedit_path_prefix_edit() {
1032 b2c50a0a 2019-07-25 stsp local testroot=`test_init histedit_path_prefix_edit`
1033 b2c50a0a 2019-07-25 stsp local orig_commit=`git_show_head $testroot/repo`
1035 b2c50a0a 2019-07-25 stsp echo "modified zeta" > $testroot/repo/epsilon/zeta
1036 b2c50a0a 2019-07-25 stsp git_commit $testroot/repo -m "changing zeta"
1037 b2c50a0a 2019-07-25 stsp local old_commit1=`git_show_head $testroot/repo`
1039 b2c50a0a 2019-07-25 stsp got diff -r $testroot/repo $orig_commit $old_commit1 \
1040 b2c50a0a 2019-07-25 stsp > $testroot/diff.expected
1042 b2c50a0a 2019-07-25 stsp got checkout -c $orig_commit -p gamma $testroot/repo \
1043 b2c50a0a 2019-07-25 stsp $testroot/wt > /dev/null
1045 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1046 b2c50a0a 2019-07-25 stsp test_done "$testroot" "$ret"
1050 b2c50a0a 2019-07-25 stsp echo "edit $old_commit1" > $testroot/histedit-script
1051 b2c50a0a 2019-07-25 stsp echo "mesg modified zeta" >> $testroot/histedit-script
1053 b2c50a0a 2019-07-25 stsp (cd $testroot/wt && got histedit -F $testroot/histedit-script \
1054 b2c50a0a 2019-07-25 stsp > $testroot/stdout 2> $testroot/stderr)
1057 49c543a6 2022-03-31 naddy if [ $ret -eq 0 ]; then
1058 b2c50a0a 2019-07-25 stsp echo "histedit succeeded unexpectedly" >&2
1059 b2c50a0a 2019-07-25 stsp test_done "$testroot" "1"
1063 b2c50a0a 2019-07-25 stsp echo -n "got: cannot edit branch history which contains changes " \
1064 b2c50a0a 2019-07-25 stsp > $testroot/stderr.expected
1065 b2c50a0a 2019-07-25 stsp echo "outside of this work tree's path prefix" \
1066 b2c50a0a 2019-07-25 stsp >> $testroot/stderr.expected
1068 b2c50a0a 2019-07-25 stsp cmp -s $testroot/stderr.expected $testroot/stderr
1070 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1071 b2c50a0a 2019-07-25 stsp diff -u $testroot/stderr.expected $testroot/stderr
1072 b2c50a0a 2019-07-25 stsp test_done "$testroot" "$ret"
1076 b2c50a0a 2019-07-25 stsp rm -rf $testroot/wt
1077 b2c50a0a 2019-07-25 stsp got checkout -c $orig_commit -p epsilon $testroot/repo \
1078 b2c50a0a 2019-07-25 stsp $testroot/wt > /dev/null
1080 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1081 b2c50a0a 2019-07-25 stsp test_done "$testroot" "$ret"
1084 b2c50a0a 2019-07-25 stsp (cd $testroot/wt && got histedit -F $testroot/histedit-script \
1085 b2c50a0a 2019-07-25 stsp > $testroot/stdout)
1087 b2c50a0a 2019-07-25 stsp local short_old_commit1=`trim_obj_id 28 $old_commit1`
1089 b2c50a0a 2019-07-25 stsp echo "G zeta" > $testroot/stdout.expected
1090 b2c50a0a 2019-07-25 stsp echo "Stopping histedit for amending commit $old_commit1" \
1091 b2c50a0a 2019-07-25 stsp >> $testroot/stdout.expected
1092 0160a755 2019-07-25 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1094 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1095 0160a755 2019-07-25 stsp diff -u $testroot/stdout.expected $testroot/stdout
1096 b2c50a0a 2019-07-25 stsp test_done "$testroot" "$ret"
1100 b2c50a0a 2019-07-25 stsp echo "modified zeta" > $testroot/content.expected
1101 b2c50a0a 2019-07-25 stsp cat $testroot/wt/zeta > $testroot/content
1102 b2c50a0a 2019-07-25 stsp cmp -s $testroot/content.expected $testroot/content
1104 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1105 b2c50a0a 2019-07-25 stsp diff -u $testroot/content.expected $testroot/content
1106 b2c50a0a 2019-07-25 stsp test_done "$testroot" "$ret"
1110 b2c50a0a 2019-07-25 stsp (cd $testroot/wt && got status > $testroot/stdout)
1112 b2c50a0a 2019-07-25 stsp echo "M zeta"> $testroot/stdout.expected
1113 b2c50a0a 2019-07-25 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1115 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1116 b2c50a0a 2019-07-25 stsp diff -u $testroot/stdout.expected $testroot/stdout
1117 b2c50a0a 2019-07-25 stsp test_done "$testroot" "$ret"
1121 b2c50a0a 2019-07-25 stsp (cd $testroot/wt && got histedit -c > $testroot/stdout)
1123 b2c50a0a 2019-07-25 stsp local new_commit1=`git_show_head $testroot/repo`
1124 b2c50a0a 2019-07-25 stsp local short_new_commit1=`trim_obj_id 28 $new_commit1`
1126 b2c50a0a 2019-07-25 stsp echo -n "$short_old_commit1 -> $short_new_commit1: " \
1127 b2c50a0a 2019-07-25 stsp > $testroot/stdout.expected
1128 b2c50a0a 2019-07-25 stsp echo "modified zeta" >> $testroot/stdout.expected
1129 b2c50a0a 2019-07-25 stsp echo "Switching work tree to refs/heads/master" \
1130 b2c50a0a 2019-07-25 stsp >> $testroot/stdout.expected
1132 b2c50a0a 2019-07-25 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1134 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1135 b2c50a0a 2019-07-25 stsp diff -u $testroot/stdout.expected $testroot/stdout
1136 b2c50a0a 2019-07-25 stsp test_done "$testroot" "$ret"
1140 b2c50a0a 2019-07-25 stsp (cd $testroot/wt && got log -l3 | grep ^commit > $testroot/stdout)
1141 b2c50a0a 2019-07-25 stsp echo "commit $new_commit1 (master)" > $testroot/stdout.expected
1142 b2c50a0a 2019-07-25 stsp echo "commit $orig_commit" >> $testroot/stdout.expected
1143 b2c50a0a 2019-07-25 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1145 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1146 b2c50a0a 2019-07-25 stsp diff -u $testroot/stdout.expected $testroot/stdout
1147 b2c50a0a 2019-07-25 stsp test_done "$testroot" "$ret"
1151 b2c50a0a 2019-07-25 stsp got diff -r $testroot/repo $orig_commit $new_commit1 \
1152 b2c50a0a 2019-07-25 stsp > $testroot/diff
1153 b2c50a0a 2019-07-25 stsp sed -i -e "s/$old_commit1/$new_commit1/" $testroot/diff.expected
1154 b2c50a0a 2019-07-25 stsp cmp -s $testroot/diff.expected $testroot/diff
1156 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1157 b2c50a0a 2019-07-25 stsp diff -u $testroot/diff.expected $testroot/diff
1159 0ebf8283 2019-07-24 stsp test_done "$testroot" "$ret"
1162 f6cae3ed 2020-09-13 naddy test_histedit_outside_refs_heads() {
1163 c7d20a3f 2019-07-30 stsp local testroot=`test_init histedit_outside_refs_heads`
1164 c7d20a3f 2019-07-30 stsp local commit1=`git_show_head $testroot/repo`
1166 c7d20a3f 2019-07-30 stsp got checkout $testroot/repo $testroot/wt > /dev/null
1168 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1169 c7d20a3f 2019-07-30 stsp echo "got checkout failed unexpectedly"
1170 c7d20a3f 2019-07-30 stsp test_done "$testroot" "$ret"
1174 c7d20a3f 2019-07-30 stsp echo "modified alpha" > $testroot/wt/alpha
1176 c7d20a3f 2019-07-30 stsp (cd $testroot/wt && got commit -m 'change alpha' \
1177 c7d20a3f 2019-07-30 stsp > $testroot/stdout 2> $testroot/stderr)
1179 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1180 c7d20a3f 2019-07-30 stsp echo "got commit failed unexpectedly" >&2
1181 c7d20a3f 2019-07-30 stsp test_done "$testroot" "1"
1184 c7d20a3f 2019-07-30 stsp local commit2=`git_show_head $testroot/repo`
1186 e31abbf2 2020-03-22 stsp got ref -r $testroot/repo -c master refs/remotes/origin/master
1188 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1189 c7d20a3f 2019-07-30 stsp echo "got ref failed unexpectedly" >&2
1190 c7d20a3f 2019-07-30 stsp test_done "$testroot" "1"
1194 c7d20a3f 2019-07-30 stsp (cd $testroot/wt && got update -b origin/master -c $commit1 >/dev/null)
1196 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1197 c7d20a3f 2019-07-30 stsp echo "got update failed unexpectedly"
1198 c7d20a3f 2019-07-30 stsp test_done "$testroot" "$ret"
1202 c7d20a3f 2019-07-30 stsp echo "edit $commit2" > $testroot/histedit-script
1203 c7d20a3f 2019-07-30 stsp (cd $testroot/wt && got histedit -F $testroot/histedit-script \
1204 c7d20a3f 2019-07-30 stsp 2> $testroot/stderr)
1206 c7d20a3f 2019-07-30 stsp echo -n "got: will not edit commit history of a branch outside the " \
1207 c7d20a3f 2019-07-30 stsp > $testroot/stderr.expected
1208 c7d20a3f 2019-07-30 stsp echo '"refs/heads/" reference namespace' \
1209 c7d20a3f 2019-07-30 stsp >> $testroot/stderr.expected
1210 c7d20a3f 2019-07-30 stsp cmp -s $testroot/stderr.expected $testroot/stderr
1212 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1213 c7d20a3f 2019-07-30 stsp diff -u $testroot/stderr.expected $testroot/stderr
1215 0def28b1 2019-08-17 stsp test_done "$testroot" "$ret"
1218 f6cae3ed 2020-09-13 naddy test_histedit_fold_last_commit_swap() {
1219 0def28b1 2019-08-17 stsp local testroot=`test_init histedit_fold_last_commit_swap`
1221 0def28b1 2019-08-17 stsp local orig_commit=`git_show_head $testroot/repo`
1223 0def28b1 2019-08-17 stsp echo "modified alpha on master" > $testroot/repo/alpha
1224 0def28b1 2019-08-17 stsp (cd $testroot/repo && git rm -q beta)
1225 0def28b1 2019-08-17 stsp echo "new file on master" > $testroot/repo/epsilon/new
1226 0def28b1 2019-08-17 stsp (cd $testroot/repo && git add epsilon/new)
1227 0def28b1 2019-08-17 stsp git_commit $testroot/repo -m "committing changes"
1228 0def28b1 2019-08-17 stsp local old_commit1=`git_show_head $testroot/repo`
1230 0def28b1 2019-08-17 stsp echo "modified zeta on master" > $testroot/repo/epsilon/zeta
1231 0def28b1 2019-08-17 stsp git_commit $testroot/repo -m "committing to zeta on master"
1232 0def28b1 2019-08-17 stsp local old_commit2=`git_show_head $testroot/repo`
1234 0def28b1 2019-08-17 stsp got checkout -c $orig_commit $testroot/repo $testroot/wt > /dev/null
1236 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1237 0def28b1 2019-08-17 stsp test_done "$testroot" "$ret"
1241 0def28b1 2019-08-17 stsp # fold commit2 into commit1 (requires swapping commits)
1242 0def28b1 2019-08-17 stsp echo "fold $old_commit2" > $testroot/histedit-script
1243 0def28b1 2019-08-17 stsp echo "pick $old_commit1" >> $testroot/histedit-script
1244 0def28b1 2019-08-17 stsp echo "mesg committing folded changes" >> $testroot/histedit-script
1246 0def28b1 2019-08-17 stsp (cd $testroot/wt && got histedit -F $testroot/histedit-script \
1247 0def28b1 2019-08-17 stsp > $testroot/stdout 2> $testroot/stderr)
1250 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1251 0def28b1 2019-08-17 stsp echo "histedit failed unexpectedly" >&2
1252 0def28b1 2019-08-17 stsp test_done "$testroot" "$ret"
1256 0def28b1 2019-08-17 stsp local new_commit=`git_show_head $testroot/repo`
1258 0def28b1 2019-08-17 stsp local short_old_commit1=`trim_obj_id 28 $old_commit1`
1259 0def28b1 2019-08-17 stsp local short_old_commit2=`trim_obj_id 28 $old_commit2`
1260 0def28b1 2019-08-17 stsp local short_new_commit=`trim_obj_id 28 $new_commit`
1262 0def28b1 2019-08-17 stsp echo "G epsilon/zeta" >> $testroot/stdout.expected
1263 0def28b1 2019-08-17 stsp echo -n "$short_old_commit2 -> fold commit: committing to zeta " \
1264 0def28b1 2019-08-17 stsp >> $testroot/stdout.expected
1265 0def28b1 2019-08-17 stsp echo "on master" >> $testroot/stdout.expected
1266 0def28b1 2019-08-17 stsp echo "G alpha" >> $testroot/stdout.expected
1267 0def28b1 2019-08-17 stsp echo "D beta" >> $testroot/stdout.expected
1268 0def28b1 2019-08-17 stsp echo "A epsilon/new" >> $testroot/stdout.expected
1269 0def28b1 2019-08-17 stsp echo -n "$short_old_commit1 -> $short_new_commit: " \
1270 0def28b1 2019-08-17 stsp >> $testroot/stdout.expected
1271 0def28b1 2019-08-17 stsp echo "committing folded changes" >> $testroot/stdout.expected
1272 0def28b1 2019-08-17 stsp echo "Switching work tree to refs/heads/master" \
1273 0def28b1 2019-08-17 stsp >> $testroot/stdout.expected
1275 0def28b1 2019-08-17 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1277 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1278 0def28b1 2019-08-17 stsp diff -u $testroot/stdout.expected $testroot/stdout
1280 c7d20a3f 2019-07-30 stsp test_done "$testroot" "$ret"
1283 f6cae3ed 2020-09-13 naddy test_histedit_split_commit() {
1284 de05890f 2020-03-05 stsp local testroot=`test_init histedit_split_commit`
1286 de05890f 2020-03-05 stsp local orig_commit=`git_show_head $testroot/repo`
1288 de05890f 2020-03-05 stsp echo "modified alpha on master" > $testroot/repo/alpha
1289 de05890f 2020-03-05 stsp (cd $testroot/repo && git rm -q beta)
1290 de05890f 2020-03-05 stsp echo "new file on master" > $testroot/repo/epsilon/new
1291 de05890f 2020-03-05 stsp (cd $testroot/repo && git add epsilon/new)
1292 de05890f 2020-03-05 stsp git_commit $testroot/repo -m "committing changes 1"
1293 de05890f 2020-03-05 stsp local old_commit1=`git_show_head $testroot/repo`
1294 de05890f 2020-03-05 stsp local short_old_commit1=`trim_obj_id 28 $old_commit1`
1296 de05890f 2020-03-05 stsp echo "modified zeta on master" > $testroot/repo/epsilon/zeta
1297 de05890f 2020-03-05 stsp git_commit $testroot/repo -m "committing changes 2"
1298 de05890f 2020-03-05 stsp local old_commit2=`git_show_head $testroot/repo`
1299 de05890f 2020-03-05 stsp local short_old_commit2=`trim_obj_id 28 $old_commit2`
1301 de05890f 2020-03-05 stsp got checkout -c $orig_commit $testroot/repo $testroot/wt > /dev/null
1303 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1304 de05890f 2020-03-05 stsp test_done "$testroot" "$ret"
1308 de05890f 2020-03-05 stsp # split commit1 into commitA and commitB and commitC
1309 de05890f 2020-03-05 stsp echo "e $old_commit1" > $testroot/histedit-script
1310 de05890f 2020-03-05 stsp echo "p $old_commit2" >> $testroot/histedit-script
1312 de05890f 2020-03-05 stsp (cd $testroot/wt && got histedit -F $testroot/histedit-script \
1313 de05890f 2020-03-05 stsp > $testroot/stdout 2> $testroot/stderr)
1315 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1316 de05890f 2020-03-05 stsp echo "histedit failed unexpectedly:" >&2
1317 de05890f 2020-03-05 stsp cat $testroot/stderr >&2
1318 de05890f 2020-03-05 stsp test_done "$testroot" "$ret"
1322 de05890f 2020-03-05 stsp echo "G alpha" > $testroot/stdout.expected
1323 de05890f 2020-03-05 stsp echo "D beta" >> $testroot/stdout.expected
1324 de05890f 2020-03-05 stsp echo "A epsilon/new" >> $testroot/stdout.expected
1325 de05890f 2020-03-05 stsp echo "Stopping histedit for amending commit $old_commit1" \
1326 de05890f 2020-03-05 stsp >> $testroot/stdout.expected
1328 de05890f 2020-03-05 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1330 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1331 de05890f 2020-03-05 stsp diff -u $testroot/stdout.expected $testroot/stdout
1332 de05890f 2020-03-05 stsp test_done "$testroot" "$ret"
1336 de05890f 2020-03-05 stsp (cd $testroot/wt && got ci -m "commitA" alpha >/dev/null)
1338 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1339 de05890f 2020-03-05 stsp echo "commit failed unexpectedly" >&2
1340 de05890f 2020-03-05 stsp test_done "$testroot" "$ret"
1344 de05890f 2020-03-05 stsp (cd $testroot/wt && got ci -m "commitB" beta >/dev/null)
1346 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1347 de05890f 2020-03-05 stsp echo "commit failed unexpectedly" >&2
1348 de05890f 2020-03-05 stsp test_done "$testroot" "$ret"
1352 de05890f 2020-03-05 stsp (cd $testroot/wt && got ci -m "commitC" epsilon/new >/dev/null)
1354 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1355 de05890f 2020-03-05 stsp echo "commit failed unexpectedly" >&2
1356 de05890f 2020-03-05 stsp test_done "$testroot" "$ret"
1360 de05890f 2020-03-05 stsp (cd $testroot/wt && got histedit -c \
1361 de05890f 2020-03-05 stsp > $testroot/stdout 2> $testroot/stderr)
1363 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1364 de05890f 2020-03-05 stsp echo "histedit failed unexpectedly:" >&2
1365 de05890f 2020-03-05 stsp cat $testroot/stderr >&2
1366 de05890f 2020-03-05 stsp test_done "$testroot" "$ret"
1369 de05890f 2020-03-05 stsp local new_commit2=`git_show_head $testroot/repo`
1370 de05890f 2020-03-05 stsp local short_new_commit2=`trim_obj_id 28 $new_commit2`
1372 de05890f 2020-03-05 stsp echo "$short_old_commit1 -> no-op change: committing changes 1" \
1373 de05890f 2020-03-05 stsp > $testroot/stdout.expected
1374 de05890f 2020-03-05 stsp echo "G epsilon/zeta" >> $testroot/stdout.expected
1375 de05890f 2020-03-05 stsp echo "$short_old_commit2 -> $short_new_commit2: committing changes 2" \
1376 de05890f 2020-03-05 stsp >> $testroot/stdout.expected
1377 de05890f 2020-03-05 stsp echo "Switching work tree to refs/heads/master" \
1378 de05890f 2020-03-05 stsp >> $testroot/stdout.expected
1380 de05890f 2020-03-05 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1382 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1383 de05890f 2020-03-05 stsp diff -u $testroot/stdout.expected $testroot/stdout
1385 5b87815e 2020-03-05 stsp test_done "$testroot" "$ret"
1389 f6cae3ed 2020-09-13 naddy test_histedit_duplicate_commit_in_script() {
1390 5b87815e 2020-03-05 stsp local testroot=`test_init histedit_duplicate_commit_in_script`
1392 5b87815e 2020-03-05 stsp local orig_commit=`git_show_head $testroot/repo`
1394 5b87815e 2020-03-05 stsp echo "modified alpha on master" > $testroot/repo/alpha
1395 5b87815e 2020-03-05 stsp (cd $testroot/repo && git rm -q beta)
1396 5b87815e 2020-03-05 stsp echo "new file on master" > $testroot/repo/epsilon/new
1397 5b87815e 2020-03-05 stsp (cd $testroot/repo && git add epsilon/new)
1398 5b87815e 2020-03-05 stsp git_commit $testroot/repo -m "committing changes 1"
1399 5b87815e 2020-03-05 stsp local old_commit1=`git_show_head $testroot/repo`
1401 5b87815e 2020-03-05 stsp echo "modified zeta on master" > $testroot/repo/epsilon/zeta
1402 5b87815e 2020-03-05 stsp git_commit $testroot/repo -m "committing changes 2"
1403 5b87815e 2020-03-05 stsp local old_commit2=`git_show_head $testroot/repo`
1405 5b87815e 2020-03-05 stsp got checkout -c $orig_commit $testroot/repo $testroot/wt > /dev/null
1407 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1408 5b87815e 2020-03-05 stsp test_done "$testroot" "$ret"
1412 5b87815e 2020-03-05 stsp # This histedit script lists commit1 more than once
1413 5b87815e 2020-03-05 stsp echo "p $old_commit1" > $testroot/histedit-script
1414 5b87815e 2020-03-05 stsp echo "p $old_commit1" >> $testroot/histedit-script
1415 5b87815e 2020-03-05 stsp echo "p $old_commit2" >> $testroot/histedit-script
1417 5b87815e 2020-03-05 stsp (cd $testroot/wt && got histedit -F $testroot/histedit-script \
1418 5b87815e 2020-03-05 stsp > $testroot/stdout 2> $testroot/stderr)
1420 49c543a6 2022-03-31 naddy if [ $ret -eq 0 ]; then
1421 5b87815e 2020-03-05 stsp echo "histedit succeeded unexpectedly:" >&2
1422 5b87815e 2020-03-05 stsp cat $testroot/stdout >&2
1423 5b87815e 2020-03-05 stsp test_done "$testroot" "$ret"
1427 5b87815e 2020-03-05 stsp echo -n "got: commit $old_commit1 is listed more than once " \
1428 5b87815e 2020-03-05 stsp > $testroot/stderr.expected
1429 5b87815e 2020-03-05 stsp echo "in histedit script" >> $testroot/stderr.expected
1431 5b87815e 2020-03-05 stsp cmp -s $testroot/stderr.expected $testroot/stderr
1433 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1434 5b87815e 2020-03-05 stsp diff -u $testroot/stderr.expected $testroot/stderr
1436 de05890f 2020-03-05 stsp test_done "$testroot" "$ret"
1440 ecfff807 2020-09-23 stsp # if a previous commit introduces a new file, and it is folded into a commit
1441 ecfff807 2020-09-23 stsp # that deletes the same file, the file still exists after the histedit
1442 ecfff807 2020-09-23 stsp test_histedit_fold_add_delete() {
1443 4c662b1d 2021-09-01 stsp local testroot=`test_init histedit_fold_add_delete`
1445 ecfff807 2020-09-23 stsp local orig_commit=`git_show_head $testroot/repo`
1447 ecfff807 2020-09-23 stsp echo "added new file epsilon/psi" > $testroot/repo/epsilon/psi
1448 ecfff807 2020-09-23 stsp (cd $testroot/repo && git add epsilon/psi)
1449 ecfff807 2020-09-23 stsp git_commit $testroot/repo -m "committing changes"
1450 ecfff807 2020-09-23 stsp local old_commit1=`git_show_head $testroot/repo`
1452 ecfff807 2020-09-23 stsp echo "modified epsilon/psi" > $testroot/repo/epsilon/psi
1453 ecfff807 2020-09-23 stsp git_commit $testroot/repo -m "editing psi"
1454 ecfff807 2020-09-23 stsp local old_commit2=`git_show_head $testroot/repo`
1456 ecfff807 2020-09-23 stsp (cd $testroot/repo && git rm -q epsilon/psi)
1457 ecfff807 2020-09-23 stsp git_commit $testroot/repo -m "removing psi"
1458 ecfff807 2020-09-23 stsp local old_commit3=`git_show_head $testroot/repo`
1460 ecfff807 2020-09-23 stsp got checkout -c $orig_commit $testroot/repo $testroot/wt > /dev/null
1462 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1463 ecfff807 2020-09-23 stsp test_done "$testroot" "$ret"
1467 ecfff807 2020-09-23 stsp echo "fold $old_commit1" > $testroot/histedit-script
1468 ecfff807 2020-09-23 stsp echo "fold $old_commit2" >> $testroot/histedit-script
1469 ecfff807 2020-09-23 stsp echo "pick $old_commit3" >> $testroot/histedit-script
1470 ecfff807 2020-09-23 stsp echo "mesg folded changes" >> $testroot/histedit-script
1472 ecfff807 2020-09-23 stsp (cd $testroot/wt && got histedit -F $testroot/histedit-script \
1473 ecfff807 2020-09-23 stsp > $testroot/stdout)
1475 ecfff807 2020-09-23 stsp local new_commit1=`git_show_head $testroot/repo`
1477 ecfff807 2020-09-23 stsp local short_old_commit1=`trim_obj_id 28 $old_commit1`
1478 ecfff807 2020-09-23 stsp local short_old_commit2=`trim_obj_id 28 $old_commit2`
1479 ecfff807 2020-09-23 stsp local short_old_commit3=`trim_obj_id 28 $old_commit3`
1480 ecfff807 2020-09-23 stsp local short_new_commit1=`trim_obj_id 28 $new_commit1`
1482 ecfff807 2020-09-23 stsp echo "A epsilon/psi" >> $testroot/stdout.expected
1483 ecfff807 2020-09-23 stsp echo "$short_old_commit1 -> fold commit: committing changes" \
1484 ecfff807 2020-09-23 stsp >> $testroot/stdout.expected
1485 ecfff807 2020-09-23 stsp echo "G epsilon/psi" >> $testroot/stdout.expected
1486 ecfff807 2020-09-23 stsp echo "$short_old_commit2 -> fold commit: editing psi" \
1487 ecfff807 2020-09-23 stsp >> $testroot/stdout.expected
1488 0a22ca1a 2020-09-23 stsp echo "D epsilon/psi" >> $testroot/stdout.expected
1489 0a22ca1a 2020-09-23 stsp echo "$short_old_commit3 -> no-op change: folded changes" \
1490 ecfff807 2020-09-23 stsp >> $testroot/stdout.expected
1491 ecfff807 2020-09-23 stsp echo "Switching work tree to refs/heads/master" \
1492 ecfff807 2020-09-23 stsp >> $testroot/stdout.expected
1494 ecfff807 2020-09-23 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1496 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1497 ecfff807 2020-09-23 stsp diff -u $testroot/stdout.expected $testroot/stdout
1498 ecfff807 2020-09-23 stsp test_done "$testroot" "$ret"
1502 ecfff807 2020-09-23 stsp if [ -e $testroot/wt/epsilon/psi ]; then
1503 0a22ca1a 2020-09-23 stsp echo "removed file psi still exists on disk" >&2
1504 0a22ca1a 2020-09-23 stsp test_done "$testroot" "1"
1508 ecfff807 2020-09-23 stsp (cd $testroot/wt && got status > $testroot/stdout)
1510 ecfff807 2020-09-23 stsp echo -n > $testroot/stdout.expected
1511 ecfff807 2020-09-23 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1513 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1514 ecfff807 2020-09-23 stsp diff -u $testroot/stdout.expected $testroot/stdout
1515 ecfff807 2020-09-23 stsp test_done "$testroot" "$ret"
1519 ecfff807 2020-09-23 stsp (cd $testroot/wt && got log -l3 | grep ^commit > $testroot/stdout)
1520 ecfff807 2020-09-23 stsp echo "commit $new_commit1 (master)" > $testroot/stdout.expected
1521 29c68398 2020-09-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1523 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1524 29c68398 2020-09-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
1525 29c68398 2020-09-24 stsp test_done "$testroot" "$ret"
1529 29c68398 2020-09-24 stsp got tree -r $testroot/repo epsilon > $testroot/stdout
1530 29c68398 2020-09-24 stsp echo "zeta" > $testroot/stdout.expected
1531 ecfff807 2020-09-23 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1533 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1534 ecfff807 2020-09-23 stsp diff -u $testroot/stdout.expected $testroot/stdout
1536 ecfff807 2020-09-23 stsp test_done "$testroot" "$ret"
1539 239f5c5a 2020-12-13 stsp test_histedit_fold_only() {
1540 239f5c5a 2020-12-13 stsp local testroot=`test_init histedit_fold_only`
1542 239f5c5a 2020-12-13 stsp local orig_commit=`git_show_head $testroot/repo`
1544 239f5c5a 2020-12-13 stsp echo "modified alpha on master" > $testroot/repo/alpha
1545 239f5c5a 2020-12-13 stsp (cd $testroot/repo && git rm -q beta)
1546 239f5c5a 2020-12-13 stsp echo "new file on master" > $testroot/repo/epsilon/new
1547 239f5c5a 2020-12-13 stsp (cd $testroot/repo && git add epsilon/new)
1548 239f5c5a 2020-12-13 stsp git_commit $testroot/repo -m "committing changes"
1549 239f5c5a 2020-12-13 stsp local old_commit1=`git_show_head $testroot/repo`
1551 239f5c5a 2020-12-13 stsp echo "modified zeta on master" > $testroot/repo/epsilon/zeta
1552 239f5c5a 2020-12-13 stsp git_commit $testroot/repo -m "committing to zeta on master"
1553 239f5c5a 2020-12-13 stsp local old_commit2=`git_show_head $testroot/repo`
1555 239f5c5a 2020-12-13 stsp echo "modified delta on master" > $testroot/repo/gamma/delta
1556 239f5c5a 2020-12-13 stsp git_commit $testroot/repo -m "committing to delta on master"
1557 239f5c5a 2020-12-13 stsp local old_commit3=`git_show_head $testroot/repo`
1559 239f5c5a 2020-12-13 stsp got checkout -c $orig_commit $testroot/repo $testroot/wt > /dev/null
1561 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1562 239f5c5a 2020-12-13 stsp test_done "$testroot" "$ret"
1566 239f5c5a 2020-12-13 stsp cat > $testroot/editor.sh <<EOF
1568 239f5c5a 2020-12-13 stsp sed -i 's/.*/committing folded changes/' "\$1"
1570 239f5c5a 2020-12-13 stsp chmod +x $testroot/editor.sh
1572 239f5c5a 2020-12-13 stsp (cd $testroot/wt && env EDITOR="$testroot/editor.sh" \
1573 239f5c5a 2020-12-13 stsp VISUAL="$testroot/editor.sh" got histedit -f > $testroot/stdout)
1575 239f5c5a 2020-12-13 stsp local new_commit1=`git_show_head $testroot/repo`
1577 239f5c5a 2020-12-13 stsp local short_old_commit1=`trim_obj_id 28 $old_commit1`
1578 239f5c5a 2020-12-13 stsp local short_old_commit2=`trim_obj_id 28 $old_commit2`
1579 239f5c5a 2020-12-13 stsp local short_old_commit3=`trim_obj_id 28 $old_commit3`
1580 239f5c5a 2020-12-13 stsp local short_new_commit1=`trim_obj_id 28 $new_commit1`
1581 239f5c5a 2020-12-13 stsp local short_new_commit2=`trim_obj_id 28 $new_commit2`
1583 239f5c5a 2020-12-13 stsp echo "G alpha" > $testroot/stdout.expected
1584 239f5c5a 2020-12-13 stsp echo "D beta" >> $testroot/stdout.expected
1585 239f5c5a 2020-12-13 stsp echo "A epsilon/new" >> $testroot/stdout.expected
1586 239f5c5a 2020-12-13 stsp echo "$short_old_commit1 -> fold commit: committing changes" \
1587 239f5c5a 2020-12-13 stsp >> $testroot/stdout.expected
1588 239f5c5a 2020-12-13 stsp echo "G epsilon/zeta" >> $testroot/stdout.expected
1589 239f5c5a 2020-12-13 stsp echo -n "$short_old_commit2 -> " >> $testroot/stdout.expected
1590 239f5c5a 2020-12-13 stsp echo "fold commit: committing to zeta on master" \
1591 239f5c5a 2020-12-13 stsp >> $testroot/stdout.expected
1592 239f5c5a 2020-12-13 stsp echo "G gamma/delta" >> $testroot/stdout.expected
1593 239f5c5a 2020-12-13 stsp echo -n "$short_old_commit3 -> $short_new_commit1: " \
1594 239f5c5a 2020-12-13 stsp >> $testroot/stdout.expected
1595 239f5c5a 2020-12-13 stsp echo "committing folded changes" >> $testroot/stdout.expected
1596 239f5c5a 2020-12-13 stsp echo "Switching work tree to refs/heads/master" \
1597 239f5c5a 2020-12-13 stsp >> $testroot/stdout.expected
1599 239f5c5a 2020-12-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1601 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1602 239f5c5a 2020-12-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
1603 239f5c5a 2020-12-13 stsp test_done "$testroot" "$ret"
1607 239f5c5a 2020-12-13 stsp echo "modified alpha on master" > $testroot/content.expected
1608 239f5c5a 2020-12-13 stsp cat $testroot/wt/alpha > $testroot/content
1609 239f5c5a 2020-12-13 stsp cmp -s $testroot/content.expected $testroot/content
1611 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1612 239f5c5a 2020-12-13 stsp diff -u $testroot/content.expected $testroot/content
1613 239f5c5a 2020-12-13 stsp test_done "$testroot" "$ret"
1617 239f5c5a 2020-12-13 stsp if [ -e $testroot/wt/beta ]; then
1618 239f5c5a 2020-12-13 stsp echo "removed file beta still exists on disk" >&2
1619 239f5c5a 2020-12-13 stsp test_done "$testroot" "1"
1623 239f5c5a 2020-12-13 stsp echo "new file on master" > $testroot/content.expected
1624 239f5c5a 2020-12-13 stsp cat $testroot/wt/epsilon/new > $testroot/content
1625 239f5c5a 2020-12-13 stsp cmp -s $testroot/content.expected $testroot/content
1627 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1628 239f5c5a 2020-12-13 stsp diff -u $testroot/content.expected $testroot/content
1629 239f5c5a 2020-12-13 stsp test_done "$testroot" "$ret"
1633 239f5c5a 2020-12-13 stsp (cd $testroot/wt && got status > $testroot/stdout)
1635 239f5c5a 2020-12-13 stsp echo -n > $testroot/stdout.expected
1636 239f5c5a 2020-12-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1638 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1639 239f5c5a 2020-12-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
1640 239f5c5a 2020-12-13 stsp test_done "$testroot" "$ret"
1644 239f5c5a 2020-12-13 stsp (cd $testroot/wt && got log | grep ^commit > $testroot/stdout)
1645 239f5c5a 2020-12-13 stsp echo "commit $new_commit1 (master)" > $testroot/stdout.expected
1646 239f5c5a 2020-12-13 stsp echo "commit $orig_commit" >> $testroot/stdout.expected
1647 239f5c5a 2020-12-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1649 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1650 239f5c5a 2020-12-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
1652 239f5c5a 2020-12-13 stsp test_done "$testroot" "$ret"
1655 a347e6bb 2020-12-13 stsp test_histedit_fold_only_empty_logmsg() {
1656 a347e6bb 2020-12-13 stsp local testroot=`test_init histedit_fold_only_empty_logmsg`
1658 a347e6bb 2020-12-13 stsp local orig_commit=`git_show_head $testroot/repo`
1660 a347e6bb 2020-12-13 stsp echo "modified alpha on master" > $testroot/repo/alpha
1661 a347e6bb 2020-12-13 stsp (cd $testroot/repo && git rm -q beta)
1662 a347e6bb 2020-12-13 stsp echo "new file on master" > $testroot/repo/epsilon/new
1663 a347e6bb 2020-12-13 stsp (cd $testroot/repo && git add epsilon/new)
1664 a347e6bb 2020-12-13 stsp git_commit $testroot/repo -m "committing changes"
1665 a347e6bb 2020-12-13 stsp local old_commit1=`git_show_head $testroot/repo`
1667 a347e6bb 2020-12-13 stsp echo "modified zeta on master" > $testroot/repo/epsilon/zeta
1668 a347e6bb 2020-12-13 stsp git_commit $testroot/repo -m "committing to zeta on master"
1669 a347e6bb 2020-12-13 stsp local old_commit2=`git_show_head $testroot/repo`
1671 a347e6bb 2020-12-13 stsp echo "modified delta on master" > $testroot/repo/gamma/delta
1672 a347e6bb 2020-12-13 stsp git_commit $testroot/repo -m "committing to delta on master"
1673 a347e6bb 2020-12-13 stsp local old_commit3=`git_show_head $testroot/repo`
1675 a347e6bb 2020-12-13 stsp got checkout -c $orig_commit $testroot/repo $testroot/wt > /dev/null
1677 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1678 a347e6bb 2020-12-13 stsp test_done "$testroot" "$ret"
1682 a347e6bb 2020-12-13 stsp cat > $testroot/editor.sh <<EOF
1684 a347e6bb 2020-12-13 stsp sed -i 'd' "\$1"
1686 a347e6bb 2020-12-13 stsp chmod +x $testroot/editor.sh
1688 a347e6bb 2020-12-13 stsp (cd $testroot/wt && env EDITOR="$testroot/editor.sh" \
1689 a347e6bb 2020-12-13 stsp VISUAL="$testroot/editor.sh" got histedit -f > $testroot/stdout)
1691 a347e6bb 2020-12-13 stsp local new_commit1=`git_show_head $testroot/repo`
1693 a347e6bb 2020-12-13 stsp local short_old_commit1=`trim_obj_id 28 $old_commit1`
1694 a347e6bb 2020-12-13 stsp local very_short_old_commit1=`trim_obj_id 29 $old_commit1`
1695 a347e6bb 2020-12-13 stsp local short_old_commit2=`trim_obj_id 28 $old_commit2`
1696 a347e6bb 2020-12-13 stsp local short_old_commit3=`trim_obj_id 28 $old_commit3`
1697 a347e6bb 2020-12-13 stsp local short_new_commit1=`trim_obj_id 28 $new_commit1`
1698 a347e6bb 2020-12-13 stsp local short_new_commit2=`trim_obj_id 28 $new_commit2`
1700 a347e6bb 2020-12-13 stsp echo "G alpha" > $testroot/stdout.expected
1701 a347e6bb 2020-12-13 stsp echo "D beta" >> $testroot/stdout.expected
1702 a347e6bb 2020-12-13 stsp echo "A epsilon/new" >> $testroot/stdout.expected
1703 a347e6bb 2020-12-13 stsp echo "$short_old_commit1 -> fold commit: committing changes" \
1704 a347e6bb 2020-12-13 stsp >> $testroot/stdout.expected
1705 a347e6bb 2020-12-13 stsp echo "G epsilon/zeta" >> $testroot/stdout.expected
1706 a347e6bb 2020-12-13 stsp echo -n "$short_old_commit2 -> " >> $testroot/stdout.expected
1707 a347e6bb 2020-12-13 stsp echo "fold commit: committing to zeta on master" \
1708 a347e6bb 2020-12-13 stsp >> $testroot/stdout.expected
1709 a347e6bb 2020-12-13 stsp echo "G gamma/delta" >> $testroot/stdout.expected
1710 a347e6bb 2020-12-13 stsp echo -n "$short_old_commit3 -> $short_new_commit1: " \
1711 a347e6bb 2020-12-13 stsp >> $testroot/stdout.expected
1712 a347e6bb 2020-12-13 stsp echo "# log message of folded commit $very_short_old_commit1" \
1713 a347e6bb 2020-12-13 stsp >> $testroot/stdout.expected
1714 a347e6bb 2020-12-13 stsp echo "Switching work tree to refs/heads/master" \
1715 a347e6bb 2020-12-13 stsp >> $testroot/stdout.expected
1717 a347e6bb 2020-12-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1719 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1720 a347e6bb 2020-12-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
1721 a347e6bb 2020-12-13 stsp test_done "$testroot" "$ret"
1725 a347e6bb 2020-12-13 stsp echo "modified alpha on master" > $testroot/content.expected
1726 a347e6bb 2020-12-13 stsp cat $testroot/wt/alpha > $testroot/content
1727 a347e6bb 2020-12-13 stsp cmp -s $testroot/content.expected $testroot/content
1729 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1730 a347e6bb 2020-12-13 stsp diff -u $testroot/content.expected $testroot/content
1731 a347e6bb 2020-12-13 stsp test_done "$testroot" "$ret"
1735 a347e6bb 2020-12-13 stsp if [ -e $testroot/wt/beta ]; then
1736 a347e6bb 2020-12-13 stsp echo "removed file beta still exists on disk" >&2
1737 a347e6bb 2020-12-13 stsp test_done "$testroot" "1"
1741 a347e6bb 2020-12-13 stsp echo "new file on master" > $testroot/content.expected
1742 a347e6bb 2020-12-13 stsp cat $testroot/wt/epsilon/new > $testroot/content
1743 a347e6bb 2020-12-13 stsp cmp -s $testroot/content.expected $testroot/content
1745 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1746 a347e6bb 2020-12-13 stsp diff -u $testroot/content.expected $testroot/content
1747 a347e6bb 2020-12-13 stsp test_done "$testroot" "$ret"
1751 a347e6bb 2020-12-13 stsp (cd $testroot/wt && got status > $testroot/stdout)
1753 a347e6bb 2020-12-13 stsp echo -n > $testroot/stdout.expected
1754 a347e6bb 2020-12-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1756 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1757 a347e6bb 2020-12-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
1758 a347e6bb 2020-12-13 stsp test_done "$testroot" "$ret"
1762 a347e6bb 2020-12-13 stsp (cd $testroot/wt && got log | grep ^commit > $testroot/stdout)
1763 a347e6bb 2020-12-13 stsp echo "commit $new_commit1 (master)" > $testroot/stdout.expected
1764 b93c7142 2021-10-01 stsp echo "commit $orig_commit" >> $testroot/stdout.expected
1765 b93c7142 2021-10-01 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1767 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1768 b93c7142 2021-10-01 stsp diff -u $testroot/stdout.expected $testroot/stdout
1770 b93c7142 2021-10-01 stsp test_done "$testroot" "$ret"
1773 b93c7142 2021-10-01 stsp test_histedit_edit_only() {
1774 b93c7142 2021-10-01 stsp local testroot=`test_init histedit_edit_only`
1776 b93c7142 2021-10-01 stsp local orig_commit=`git_show_head $testroot/repo`
1778 b93c7142 2021-10-01 stsp echo "modified alpha on master" > $testroot/repo/alpha
1779 b93c7142 2021-10-01 stsp (cd $testroot/repo && git rm -q beta)
1780 b93c7142 2021-10-01 stsp echo "new file on master" > $testroot/repo/epsilon/new
1781 b93c7142 2021-10-01 stsp (cd $testroot/repo && git add epsilon/new)
1782 b93c7142 2021-10-01 stsp git_commit $testroot/repo -m "committing changes"
1783 b93c7142 2021-10-01 stsp local old_commit1=`git_show_head $testroot/repo`
1785 b93c7142 2021-10-01 stsp echo "modified zeta on master" > $testroot/repo/epsilon/zeta
1786 b93c7142 2021-10-01 stsp git_commit $testroot/repo -m "committing to zeta on master"
1787 b93c7142 2021-10-01 stsp local old_commit2=`git_show_head $testroot/repo`
1789 b93c7142 2021-10-01 stsp got checkout -c $orig_commit $testroot/repo $testroot/wt > /dev/null
1791 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1792 b93c7142 2021-10-01 stsp test_done "$testroot" "$ret"
1796 b93c7142 2021-10-01 stsp (cd $testroot/wt && got histedit -e > $testroot/stdout)
1798 b93c7142 2021-10-01 stsp local short_old_commit1=`trim_obj_id 28 $old_commit1`
1799 b93c7142 2021-10-01 stsp local short_old_commit2=`trim_obj_id 28 $old_commit2`
1801 b93c7142 2021-10-01 stsp echo "G alpha" > $testroot/stdout.expected
1802 b93c7142 2021-10-01 stsp echo "D beta" >> $testroot/stdout.expected
1803 b93c7142 2021-10-01 stsp echo "A epsilon/new" >> $testroot/stdout.expected
1804 b93c7142 2021-10-01 stsp echo "Stopping histedit for amending commit $old_commit1" \
1805 b93c7142 2021-10-01 stsp >> $testroot/stdout.expected
1806 b93c7142 2021-10-01 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1808 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1809 b93c7142 2021-10-01 stsp diff -u $testroot/stdout.expected $testroot/stdout
1810 b93c7142 2021-10-01 stsp test_done "$testroot" "$ret"
1814 b93c7142 2021-10-01 stsp echo "edited modified alpha on master" > $testroot/wt/alpha
1816 b93c7142 2021-10-01 stsp cat > $testroot/editor.sh <<EOF
1818 b93c7142 2021-10-01 stsp sed -i 's/.*/committing edited changes 1/' "\$1"
1820 b93c7142 2021-10-01 stsp chmod +x $testroot/editor.sh
1822 b93c7142 2021-10-01 stsp (cd $testroot/wt && env EDITOR="$testroot/editor.sh" \
1823 b93c7142 2021-10-01 stsp VISUAL="$testroot/editor.sh" got histedit -c > $testroot/stdout)
1825 b93c7142 2021-10-01 stsp local new_commit1=$(cd $testroot/wt && got info | \
1826 b93c7142 2021-10-01 stsp grep '^work tree base commit: ' | cut -d: -f2 | tr -d ' ')
1827 b93c7142 2021-10-01 stsp local short_new_commit1=`trim_obj_id 28 $new_commit1`
1829 b93c7142 2021-10-01 stsp echo -n "$short_old_commit1 -> $short_new_commit1: " \
1830 b93c7142 2021-10-01 stsp > $testroot/stdout.expected
1831 b93c7142 2021-10-01 stsp echo "committing edited changes 1" >> $testroot/stdout.expected
1832 b93c7142 2021-10-01 stsp echo "G epsilon/zeta" >> $testroot/stdout.expected
1833 b93c7142 2021-10-01 stsp echo "Stopping histedit for amending commit $old_commit2" \
1834 b93c7142 2021-10-01 stsp >> $testroot/stdout.expected
1835 b93c7142 2021-10-01 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1837 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1838 b93c7142 2021-10-01 stsp diff -u $testroot/stdout.expected $testroot/stdout
1839 b93c7142 2021-10-01 stsp test_done "$testroot" "$ret"
1843 b93c7142 2021-10-01 stsp echo "edited zeta on master" > $testroot/wt/epsilon/zeta
1845 b93c7142 2021-10-01 stsp cat > $testroot/editor.sh <<EOF
1847 b93c7142 2021-10-01 stsp sed -i 's/.*/committing edited changes 2/' "\$1"
1849 b93c7142 2021-10-01 stsp chmod +x $testroot/editor.sh
1851 b93c7142 2021-10-01 stsp (cd $testroot/wt && env EDITOR="$testroot/editor.sh" \
1852 b93c7142 2021-10-01 stsp VISUAL="$testroot/editor.sh" got histedit -c > $testroot/stdout)
1854 b93c7142 2021-10-01 stsp local new_commit2=`git_show_head $testroot/repo`
1855 b93c7142 2021-10-01 stsp local short_new_commit2=`trim_obj_id 28 $new_commit2`
1857 b93c7142 2021-10-01 stsp echo -n "$short_old_commit2 -> $short_new_commit2: " \
1858 b93c7142 2021-10-01 stsp > $testroot/stdout.expected
1859 b93c7142 2021-10-01 stsp echo "committing edited changes 2" >> $testroot/stdout.expected
1860 b93c7142 2021-10-01 stsp echo "Switching work tree to refs/heads/master" \
1861 b93c7142 2021-10-01 stsp >> $testroot/stdout.expected
1863 b93c7142 2021-10-01 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1865 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1866 b93c7142 2021-10-01 stsp diff -u $testroot/stdout.expected $testroot/stdout
1867 b93c7142 2021-10-01 stsp test_done "$testroot" "$ret"
1871 b93c7142 2021-10-01 stsp echo "edited modified alpha on master" > $testroot/content.expected
1872 b93c7142 2021-10-01 stsp cat $testroot/wt/alpha > $testroot/content
1873 b93c7142 2021-10-01 stsp cmp -s $testroot/content.expected $testroot/content
1875 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1876 b93c7142 2021-10-01 stsp diff -u $testroot/content.expected $testroot/content
1877 b93c7142 2021-10-01 stsp test_done "$testroot" "$ret"
1881 b93c7142 2021-10-01 stsp if [ -e $testroot/wt/beta ]; then
1882 b93c7142 2021-10-01 stsp echo "removed file beta still exists on disk" >&2
1883 b93c7142 2021-10-01 stsp test_done "$testroot" "1"
1887 b93c7142 2021-10-01 stsp echo "new file on master" > $testroot/content.expected
1888 b93c7142 2021-10-01 stsp cat $testroot/wt/epsilon/new > $testroot/content
1889 b93c7142 2021-10-01 stsp cmp -s $testroot/content.expected $testroot/content
1891 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1892 b93c7142 2021-10-01 stsp diff -u $testroot/content.expected $testroot/content
1893 b93c7142 2021-10-01 stsp test_done "$testroot" "$ret"
1897 b93c7142 2021-10-01 stsp (cd $testroot/wt && got status > $testroot/stdout)
1899 b93c7142 2021-10-01 stsp echo -n > $testroot/stdout.expected
1900 b93c7142 2021-10-01 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1902 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1903 b93c7142 2021-10-01 stsp diff -u $testroot/stdout.expected $testroot/stdout
1904 b93c7142 2021-10-01 stsp test_done "$testroot" "$ret"
1908 b93c7142 2021-10-01 stsp (cd $testroot/wt && got log -l3 | grep ^commit > $testroot/stdout)
1909 b93c7142 2021-10-01 stsp echo "commit $new_commit2 (master)" > $testroot/stdout.expected
1910 b93c7142 2021-10-01 stsp echo "commit $new_commit1" >> $testroot/stdout.expected
1911 a347e6bb 2020-12-13 stsp echo "commit $orig_commit" >> $testroot/stdout.expected
1912 a347e6bb 2020-12-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1914 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1915 a347e6bb 2020-12-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
1917 a347e6bb 2020-12-13 stsp test_done "$testroot" "$ret"
1920 09209b8a 2021-10-08 stsp test_histedit_prepend_line() {
1921 09209b8a 2021-10-08 stsp local testroot=`test_init histedit_prepend_line`
1922 09209b8a 2021-10-08 stsp local orig_commit=`git_show_head $testroot/repo`
1924 09209b8a 2021-10-08 stsp got checkout $testroot/repo $testroot/wt > /dev/null
1926 09209b8a 2021-10-08 stsp ed "$testroot/wt/alpha" <<EOF >/dev/null 2>&1
1928 09209b8a 2021-10-08 stsp first line
1933 09209b8a 2021-10-08 stsp cp $testroot/wt/alpha $testroot/content.expected
1935 09209b8a 2021-10-08 stsp (cd $testroot/wt/ && got commit -m 'modified alpha on master' \
1936 09209b8a 2021-10-08 stsp alpha > /dev/null)
1938 09209b8a 2021-10-08 stsp if [ "$?" != 0 ]; then
1939 09209b8a 2021-10-08 stsp echo "got commit failed unexpectedly" >&2
1940 09209b8a 2021-10-08 stsp test_done "$testroot" "$ret"
1944 09209b8a 2021-10-08 stsp local top_commit=`git_show_head $testroot/repo`
1945 09209b8a 2021-10-08 stsp echo "pick $top_commit" > "$testroot/histedit-script"
1947 09209b8a 2021-10-08 stsp (cd $testroot/wt/ && got update -c $orig_commit > /dev/null)
1949 09209b8a 2021-10-08 stsp if [ "$?" != 0 ]; then
1950 09209b8a 2021-10-08 stsp echo "got update failed unexpectedly" >&2
1951 09209b8a 2021-10-08 stsp test_done "$testroot" "$ret"
1955 09209b8a 2021-10-08 stsp (cd $testroot/wt && got histedit -F "$testroot/histedit-script" \
1956 09209b8a 2021-10-08 stsp > /dev/null)
1958 09209b8a 2021-10-08 stsp if [ "$?" != 0 ]; then
1959 09209b8a 2021-10-08 stsp echo "got histedit failed unexpectedly" >&2
1960 09209b8a 2021-10-08 stsp test_done "$testroot" "$ret"
1964 09209b8a 2021-10-08 stsp cp $testroot/wt/alpha $testroot/content
1965 09209b8a 2021-10-08 stsp cmp -s $testroot/content.expected $testroot/content
1967 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1968 09209b8a 2021-10-08 stsp diff -u $testroot/content.expected $testroot/content
1969 09209b8a 2021-10-08 stsp test_done "$testroot" "$ret"
1973 09209b8a 2021-10-08 stsp test_done "$testroot" $ret
1976 7fb414ae 2020-08-08 stsp test_parseargs "$@"
1977 0ebf8283 2019-07-24 stsp run_test test_histedit_no_op
1978 0ebf8283 2019-07-24 stsp run_test test_histedit_swap
1979 0ebf8283 2019-07-24 stsp run_test test_histedit_drop
1980 0ebf8283 2019-07-24 stsp run_test test_histedit_fold
1981 0ebf8283 2019-07-24 stsp run_test test_histedit_edit
1982 0ebf8283 2019-07-24 stsp run_test test_histedit_fold_last_commit
1983 0ebf8283 2019-07-24 stsp run_test test_histedit_missing_commit
1984 0ebf8283 2019-07-24 stsp run_test test_histedit_abort
1985 a4027091 2019-07-25 stsp run_test test_histedit_path_prefix_drop
1986 b2c50a0a 2019-07-25 stsp run_test test_histedit_path_prefix_edit
1987 c7d20a3f 2019-07-30 stsp run_test test_histedit_outside_refs_heads
1988 0def28b1 2019-08-17 stsp run_test test_histedit_fold_last_commit_swap
1989 de05890f 2020-03-05 stsp run_test test_histedit_split_commit
1990 5b87815e 2020-03-05 stsp run_test test_histedit_duplicate_commit_in_script
1991 ecfff807 2020-09-23 stsp run_test test_histedit_fold_add_delete
1992 239f5c5a 2020-12-13 stsp run_test test_histedit_fold_only
1993 a347e6bb 2020-12-13 stsp run_test test_histedit_fold_only_empty_logmsg
1994 b93c7142 2021-10-01 stsp run_test test_histedit_edit_only
1995 09209b8a 2021-10-08 stsp run_test test_histedit_prepend_line