README_DOCS.rst: update tg prev and tg next usage summary
[topgit/pro.git] / t / t6100-tag-reflog.sh
blobf8981689cad4aae2447bfefd195f933b3c30c72c
1 #!/bin/sh
3 test_description='check tg tag reflog operations'
5 TEST_NO_CREATE_REPO=1
7 . ./test-lib.sh
9 TZ=PST8PDT && export TZ || die
11 if vcmp "$git_version" '>=' "2.5"; then
12 test_set_prereq "GIT_2_5"
15 git_231_plus=
16 if vcmp "$git_version" '>=' "2.31"; then
17 git_231_plus=1
18 test_set_prereq "GIT_2_31"
21 test_plan 50
23 commit_empty_root() {
24 _gt="$(git mktree </dev/null)" &&
25 test_tick &&
26 _gc="$(git commit-tree -m "$*" "$_gt")" &&
27 git update-ref HEAD "$_gc" ""
30 commit_orphan() {
31 _gt="$(git write-tree)" &&
32 test_tick &&
33 _gc="$(git commit-tree -m "$*" "$_gt")" &&
34 git update-ref HEAD "$_gc" HEAD
37 # replace `git symbolic-ref HEAD refs/heads/foo`
38 # with `sane_reattach_ref HEAD refs/heads/foo`
39 sane_reattach_ref() {
40 _rlc="$(git reflog show "$1" -- | wc -l)" &&
41 git symbolic-ref "$1" "$2" &&
42 _rlc2="$(git reflog show "$1" -- | wc -l)" &&
43 if test x"$_rlc" != x"$_rlc2"; then
44 git reflog delete "$1@{0}" &&
45 _rlc2="$(git reflog show "$1" -- | wc -l)" &&
46 test x"$_rlc" = x"$_rlc2"
50 test_expect_success 'setup main' '
51 test_create_repo main &&
52 cd main &&
53 git config core.abbrev 8 &&
54 git config log.decorate 0 &&
55 commit_empty_root "empty" &&
56 mtcommit="$(git rev-parse --verify HEAD)" && test -n "$mtcommit" &&
57 test_when_finished mtcommit="$mtcommit" &&
58 echo file1 >file1 &&
59 git add file1 &&
60 commit_orphan "file 1" &&
61 git read-tree --empty &&
62 echo file2 >file2 &&
63 hash2="$(git hash-object -w --stdin -t blob <file2)" && test -n "$hash2" &&
64 test_when_finished hash2="$hash2" &&
65 git add file2 &&
66 commit_orphan "file 2" &&
67 git read-tree --empty &&
68 echo file3 >file3 &&
69 git add file3 &&
70 commit_orphan "file 3" &&
71 git read-tree --empty &&
72 echo file4 >file4 &&
73 git add file4 &&
74 commit_orphan "file 4" &&
75 c4="$(git rev-parse --verify HEAD)" && test -n "$c4" &&
76 git read-tree --empty &&
77 echo file5 >file5 &&
78 hash5="$(git hash-object -w --stdin -t blob <file5)" && test -n "$hash5" &&
79 test_when_finished hash5="$hash5" &&
80 git add file5 &&
81 commit_orphan "file 5" &&
82 git read-tree --empty &&
83 echo file6 >file6 &&
84 git add file6 &&
85 commit_orphan "file 6" &&
86 git read-tree --empty &&
87 echo file7 >file7 &&
88 git add file7 &&
89 commit_orphan "file 7" &&
90 c7="$(git rev-parse --verify HEAD)" && test -n "$c7" &&
91 git update-ref --no-deref -m "detaching to c4" HEAD "$c4" HEAD &&
92 git update-ref --no-deref -m "attaching back to c7" HEAD "$c7" HEAD &&
93 sane_reattach_ref HEAD refs/heads/master &&
94 echo "$hash2" >objs &&
95 echo "$hash5" >>objs &&
96 pack="$(git pack-objects <objs .git/objects/pack/pack)" && test -n "$pack" &&
97 test -s ".git/objects/pack/pack-$pack.idx" &&
98 test -s ".git/objects/pack/pack-$pack.pack" &&
99 git prune-packed &&
100 rm objs &&
101 test_when_finished objpack="pack-$pack"
104 test_expect_success 'LASTOK GIT_2_5' 'setup linked' '
105 git --git-dir=main/.git worktree add --no-checkout -b linked linked "$mtcommit" &&
106 cd linked &&
107 # there should be a HEAD@{0} now but there probably is not
108 # remove it just in case so this test does not break if it ever gets fixed
109 test_might_fail git reflog delete HEAD@{0} &&
110 git update-ref -d refs/heads/linked &&
111 commit_empty_root "empty linked" &&
112 # get rid of "magic" HEAD ref log entry added because its symref was deleted
113 test_might_fail git reflog delete HEAD@{1} &&
114 git read-tree --empty &&
115 echo file7 >file7 &&
116 git add file7 &&
117 commit_orphan "file 7" &&
118 git read-tree --empty &&
119 echo file6 >file6 &&
120 git add file6 &&
121 commit_orphan "file 6" &&
122 git read-tree --empty &&
123 echo file5 >file5 &&
124 git add file5 &&
125 commit_orphan "file 5" &&
126 git read-tree --empty &&
127 echo file4 >file4 &&
128 git add file4 &&
129 commit_orphan "file 4" &&
130 c4="$(git rev-parse --verify HEAD)" && test -n "$c4" &&
131 git read-tree --empty &&
132 echo file3 >file3 &&
133 git add file3 &&
134 commit_orphan "file 3" &&
135 git read-tree --empty &&
136 echo file2 >file2 &&
137 git add file2 &&
138 commit_orphan "file 2" &&
139 git read-tree --empty &&
140 echo file1 >file1 &&
141 git add file1 &&
142 commit_orphan "file 1" &&
143 c1="$(git rev-parse --verify HEAD)" && test -n "$c1" &&
144 git update-ref --no-deref -m "detaching to linked c4" HEAD "$c4" HEAD &&
145 git update-ref --no-deref -m "attaching back to linked c1" HEAD "$c1" HEAD &&
146 sane_reattach_ref HEAD refs/heads/linked
149 test "$test_hash_algo" != "sha1" ||
150 cat <<\EOT >HEAD_main.log || die
151 commit dd1016e3aedddb592ab8b1075dc5957c2c770c57
152 Reflog: HEAD@{0} (Fra mewor k (Committer) <framework@example.org>)
153 Reflog message: attaching back to c7
154 Author: Te s t (Author) <test@example.net>
155 AuthorDate: Thu Apr 7 15:20:13 2005 -0700
156 Commit: Fra mewor k (Committer) <framework@example.org>
157 CommitDate: Thu Apr 7 15:20:13 2005 -0700
159 file 7
161 commit 40403e00fa16ee338d54ab86d67dde8b8017312d
162 Reflog: HEAD@{1} (Fra mewor k (Committer) <framework@example.org>)
163 Reflog message: detaching to c4
164 Author: Te s t (Author) <test@example.net>
165 AuthorDate: Thu Apr 7 15:17:13 2005 -0700
166 Commit: Fra mewor k (Committer) <framework@example.org>
167 CommitDate: Thu Apr 7 15:17:13 2005 -0700
169 file 4
171 commit dd1016e3aedddb592ab8b1075dc5957c2c770c57
172 Reflog: HEAD@{2} (Fra mewor k (Committer) <framework@example.org>)
173 Reflog message:
174 Author: Te s t (Author) <test@example.net>
175 AuthorDate: Thu Apr 7 15:20:13 2005 -0700
176 Commit: Fra mewor k (Committer) <framework@example.org>
177 CommitDate: Thu Apr 7 15:20:13 2005 -0700
179 file 7
181 commit 84b1e4e6dd88903b38db5c1e41bcb048abafa044
182 Reflog: HEAD@{3} (Fra mewor k (Committer) <framework@example.org>)
183 Reflog message:
184 Author: Te s t (Author) <test@example.net>
185 AuthorDate: Thu Apr 7 15:19:13 2005 -0700
186 Commit: Fra mewor k (Committer) <framework@example.org>
187 CommitDate: Thu Apr 7 15:19:13 2005 -0700
189 file 6
191 commit 8238c7e733e43fb89537cf4cae44d31a5438acd6
192 Reflog: HEAD@{4} (Fra mewor k (Committer) <framework@example.org>)
193 Reflog message:
194 Author: Te s t (Author) <test@example.net>
195 AuthorDate: Thu Apr 7 15:18:13 2005 -0700
196 Commit: Fra mewor k (Committer) <framework@example.org>
197 CommitDate: Thu Apr 7 15:18:13 2005 -0700
199 file 5
201 commit 40403e00fa16ee338d54ab86d67dde8b8017312d
202 Reflog: HEAD@{5} (Fra mewor k (Committer) <framework@example.org>)
203 Reflog message:
204 Author: Te s t (Author) <test@example.net>
205 AuthorDate: Thu Apr 7 15:17:13 2005 -0700
206 Commit: Fra mewor k (Committer) <framework@example.org>
207 CommitDate: Thu Apr 7 15:17:13 2005 -0700
209 file 4
211 commit feeb764a0c96556642f118177871e09693a1ea2c
212 Reflog: HEAD@{6} (Fra mewor k (Committer) <framework@example.org>)
213 Reflog message:
214 Author: Te s t (Author) <test@example.net>
215 AuthorDate: Thu Apr 7 15:16:13 2005 -0700
216 Commit: Fra mewor k (Committer) <framework@example.org>
217 CommitDate: Thu Apr 7 15:16:13 2005 -0700
219 file 3
221 commit c0ed6e70c9c2edcaa98118b9c26a98e4f9beba3c
222 Reflog: HEAD@{7} (Fra mewor k (Committer) <framework@example.org>)
223 Reflog message:
224 Author: Te s t (Author) <test@example.net>
225 AuthorDate: Thu Apr 7 15:15:13 2005 -0700
226 Commit: Fra mewor k (Committer) <framework@example.org>
227 CommitDate: Thu Apr 7 15:15:13 2005 -0700
229 file 2
231 commit c18fcef2dd73f7969b45b108d061309b670c886c
232 Reflog: HEAD@{8} (Fra mewor k (Committer) <framework@example.org>)
233 Reflog message:
234 Author: Te s t (Author) <test@example.net>
235 AuthorDate: Thu Apr 7 15:14:13 2005 -0700
236 Commit: Fra mewor k (Committer) <framework@example.org>
237 CommitDate: Thu Apr 7 15:14:13 2005 -0700
239 file 1
241 commit b63866e540ea13ef92d9eaad23c571912019da41
242 Reflog: HEAD@{9} (Fra mewor k (Committer) <framework@example.org>)
243 Reflog message:
244 Author: Te s t (Author) <test@example.net>
245 AuthorDate: Thu Apr 7 15:13:13 2005 -0700
246 Commit: Fra mewor k (Committer) <framework@example.org>
247 CommitDate: Thu Apr 7 15:13:13 2005 -0700
249 empty
252 test "$test_hash_algo" != "sha1" ||
253 cat <<\EOT >HEAD_linked.log || die
254 commit 04eea982f4572b35c7cbb6597f5d777661f15e60
255 Reflog: HEAD@{0} (Fra mewor k (Committer) <framework@example.org>)
256 Reflog message: attaching back to linked c1
257 Author: Te s t (Author) <test@example.net>
258 AuthorDate: Thu Apr 7 15:20:13 2005 -0700
259 Commit: Fra mewor k (Committer) <framework@example.org>
260 CommitDate: Thu Apr 7 15:20:13 2005 -0700
262 file 1
264 commit 40403e00fa16ee338d54ab86d67dde8b8017312d
265 Reflog: HEAD@{1} (Fra mewor k (Committer) <framework@example.org>)
266 Reflog message: detaching to linked c4
267 Author: Te s t (Author) <test@example.net>
268 AuthorDate: Thu Apr 7 15:17:13 2005 -0700
269 Commit: Fra mewor k (Committer) <framework@example.org>
270 CommitDate: Thu Apr 7 15:17:13 2005 -0700
272 file 4
274 commit 04eea982f4572b35c7cbb6597f5d777661f15e60
275 Reflog: HEAD@{2} (Fra mewor k (Committer) <framework@example.org>)
276 Reflog message:
277 Author: Te s t (Author) <test@example.net>
278 AuthorDate: Thu Apr 7 15:20:13 2005 -0700
279 Commit: Fra mewor k (Committer) <framework@example.org>
280 CommitDate: Thu Apr 7 15:20:13 2005 -0700
282 file 1
284 commit 4d776c6492d2e482e7d5a7673eec6a003e1f2f28
285 Reflog: HEAD@{3} (Fra mewor k (Committer) <framework@example.org>)
286 Reflog message:
287 Author: Te s t (Author) <test@example.net>
288 AuthorDate: Thu Apr 7 15:19:13 2005 -0700
289 Commit: Fra mewor k (Committer) <framework@example.org>
290 CommitDate: Thu Apr 7 15:19:13 2005 -0700
292 file 2
294 commit 602d59a7ea59e60a4776c39f5cefde1e250e7e21
295 Reflog: HEAD@{4} (Fra mewor k (Committer) <framework@example.org>)
296 Reflog message:
297 Author: Te s t (Author) <test@example.net>
298 AuthorDate: Thu Apr 7 15:18:13 2005 -0700
299 Commit: Fra mewor k (Committer) <framework@example.org>
300 CommitDate: Thu Apr 7 15:18:13 2005 -0700
302 file 3
304 commit 40403e00fa16ee338d54ab86d67dde8b8017312d
305 Reflog: HEAD@{5} (Fra mewor k (Committer) <framework@example.org>)
306 Reflog message:
307 Author: Te s t (Author) <test@example.net>
308 AuthorDate: Thu Apr 7 15:17:13 2005 -0700
309 Commit: Fra mewor k (Committer) <framework@example.org>
310 CommitDate: Thu Apr 7 15:17:13 2005 -0700
312 file 4
314 commit 0a45d4757beafde42dba7b9e228f4fca4d2c2570
315 Reflog: HEAD@{6} (Fra mewor k (Committer) <framework@example.org>)
316 Reflog message:
317 Author: Te s t (Author) <test@example.net>
318 AuthorDate: Thu Apr 7 15:16:13 2005 -0700
319 Commit: Fra mewor k (Committer) <framework@example.org>
320 CommitDate: Thu Apr 7 15:16:13 2005 -0700
322 file 5
324 commit e053b7d1bf32cbf73d07ebccef4f717375b27af8
325 Reflog: HEAD@{7} (Fra mewor k (Committer) <framework@example.org>)
326 Reflog message:
327 Author: Te s t (Author) <test@example.net>
328 AuthorDate: Thu Apr 7 15:15:13 2005 -0700
329 Commit: Fra mewor k (Committer) <framework@example.org>
330 CommitDate: Thu Apr 7 15:15:13 2005 -0700
332 file 6
334 commit 2849f113c66cbf3c9521e90be3bc7e39fce8db16
335 Reflog: HEAD@{8} (Fra mewor k (Committer) <framework@example.org>)
336 Reflog message:
337 Author: Te s t (Author) <test@example.net>
338 AuthorDate: Thu Apr 7 15:14:13 2005 -0700
339 Commit: Fra mewor k (Committer) <framework@example.org>
340 CommitDate: Thu Apr 7 15:14:13 2005 -0700
342 file 7
344 commit fce870c7720ff513ea5dd3c60d6972ed70c41d1f
345 Reflog: HEAD@{9} (Fra mewor k (Committer) <framework@example.org>)
346 Reflog message:
347 Author: Te s t (Author) <test@example.net>
348 AuthorDate: Thu Apr 7 15:13:13 2005 -0700
349 Commit: Fra mewor k (Committer) <framework@example.org>
350 CommitDate: Thu Apr 7 15:13:13 2005 -0700
352 empty linked
355 test "$test_hash_algo" != "sha1" ||
356 cat <<\EOT >master.log
357 commit dd1016e3aedddb592ab8b1075dc5957c2c770c57
358 Reflog: master@{0} (Fra mewor k (Committer) <framework@example.org>)
359 Reflog message:
360 Author: Te s t (Author) <test@example.net>
361 AuthorDate: Thu Apr 7 15:20:13 2005 -0700
362 Commit: Fra mewor k (Committer) <framework@example.org>
363 CommitDate: Thu Apr 7 15:20:13 2005 -0700
365 file 7
367 commit 84b1e4e6dd88903b38db5c1e41bcb048abafa044
368 Reflog: master@{1} (Fra mewor k (Committer) <framework@example.org>)
369 Reflog message:
370 Author: Te s t (Author) <test@example.net>
371 AuthorDate: Thu Apr 7 15:19:13 2005 -0700
372 Commit: Fra mewor k (Committer) <framework@example.org>
373 CommitDate: Thu Apr 7 15:19:13 2005 -0700
375 file 6
377 commit 8238c7e733e43fb89537cf4cae44d31a5438acd6
378 Reflog: master@{2} (Fra mewor k (Committer) <framework@example.org>)
379 Reflog message:
380 Author: Te s t (Author) <test@example.net>
381 AuthorDate: Thu Apr 7 15:18:13 2005 -0700
382 Commit: Fra mewor k (Committer) <framework@example.org>
383 CommitDate: Thu Apr 7 15:18:13 2005 -0700
385 file 5
387 commit 40403e00fa16ee338d54ab86d67dde8b8017312d
388 Reflog: master@{3} (Fra mewor k (Committer) <framework@example.org>)
389 Reflog message:
390 Author: Te s t (Author) <test@example.net>
391 AuthorDate: Thu Apr 7 15:17:13 2005 -0700
392 Commit: Fra mewor k (Committer) <framework@example.org>
393 CommitDate: Thu Apr 7 15:17:13 2005 -0700
395 file 4
397 commit feeb764a0c96556642f118177871e09693a1ea2c
398 Reflog: master@{4} (Fra mewor k (Committer) <framework@example.org>)
399 Reflog message:
400 Author: Te s t (Author) <test@example.net>
401 AuthorDate: Thu Apr 7 15:16:13 2005 -0700
402 Commit: Fra mewor k (Committer) <framework@example.org>
403 CommitDate: Thu Apr 7 15:16:13 2005 -0700
405 file 3
407 commit c0ed6e70c9c2edcaa98118b9c26a98e4f9beba3c
408 Reflog: master@{5} (Fra mewor k (Committer) <framework@example.org>)
409 Reflog message:
410 Author: Te s t (Author) <test@example.net>
411 AuthorDate: Thu Apr 7 15:15:13 2005 -0700
412 Commit: Fra mewor k (Committer) <framework@example.org>
413 CommitDate: Thu Apr 7 15:15:13 2005 -0700
415 file 2
417 commit c18fcef2dd73f7969b45b108d061309b670c886c
418 Reflog: master@{6} (Fra mewor k (Committer) <framework@example.org>)
419 Reflog message:
420 Author: Te s t (Author) <test@example.net>
421 AuthorDate: Thu Apr 7 15:14:13 2005 -0700
422 Commit: Fra mewor k (Committer) <framework@example.org>
423 CommitDate: Thu Apr 7 15:14:13 2005 -0700
425 file 1
427 commit b63866e540ea13ef92d9eaad23c571912019da41
428 Reflog: master@{7} (Fra mewor k (Committer) <framework@example.org>)
429 Reflog message:
430 Author: Te s t (Author) <test@example.net>
431 AuthorDate: Thu Apr 7 15:13:13 2005 -0700
432 Commit: Fra mewor k (Committer) <framework@example.org>
433 CommitDate: Thu Apr 7 15:13:13 2005 -0700
435 empty
438 test "$test_hash_algo" != "sha1" ||
439 cat <<\EOT >linked.log
440 commit 04eea982f4572b35c7cbb6597f5d777661f15e60
441 Reflog: linked@{0} (Fra mewor k (Committer) <framework@example.org>)
442 Reflog message:
443 Author: Te s t (Author) <test@example.net>
444 AuthorDate: Thu Apr 7 15:20:13 2005 -0700
445 Commit: Fra mewor k (Committer) <framework@example.org>
446 CommitDate: Thu Apr 7 15:20:13 2005 -0700
448 file 1
450 commit 4d776c6492d2e482e7d5a7673eec6a003e1f2f28
451 Reflog: linked@{1} (Fra mewor k (Committer) <framework@example.org>)
452 Reflog message:
453 Author: Te s t (Author) <test@example.net>
454 AuthorDate: Thu Apr 7 15:19:13 2005 -0700
455 Commit: Fra mewor k (Committer) <framework@example.org>
456 CommitDate: Thu Apr 7 15:19:13 2005 -0700
458 file 2
460 commit 602d59a7ea59e60a4776c39f5cefde1e250e7e21
461 Reflog: linked@{2} (Fra mewor k (Committer) <framework@example.org>)
462 Reflog message:
463 Author: Te s t (Author) <test@example.net>
464 AuthorDate: Thu Apr 7 15:18:13 2005 -0700
465 Commit: Fra mewor k (Committer) <framework@example.org>
466 CommitDate: Thu Apr 7 15:18:13 2005 -0700
468 file 3
470 commit 40403e00fa16ee338d54ab86d67dde8b8017312d
471 Reflog: linked@{3} (Fra mewor k (Committer) <framework@example.org>)
472 Reflog message:
473 Author: Te s t (Author) <test@example.net>
474 AuthorDate: Thu Apr 7 15:17:13 2005 -0700
475 Commit: Fra mewor k (Committer) <framework@example.org>
476 CommitDate: Thu Apr 7 15:17:13 2005 -0700
478 file 4
480 commit 0a45d4757beafde42dba7b9e228f4fca4d2c2570
481 Reflog: linked@{4} (Fra mewor k (Committer) <framework@example.org>)
482 Reflog message:
483 Author: Te s t (Author) <test@example.net>
484 AuthorDate: Thu Apr 7 15:16:13 2005 -0700
485 Commit: Fra mewor k (Committer) <framework@example.org>
486 CommitDate: Thu Apr 7 15:16:13 2005 -0700
488 file 5
490 commit e053b7d1bf32cbf73d07ebccef4f717375b27af8
491 Reflog: linked@{5} (Fra mewor k (Committer) <framework@example.org>)
492 Reflog message:
493 Author: Te s t (Author) <test@example.net>
494 AuthorDate: Thu Apr 7 15:15:13 2005 -0700
495 Commit: Fra mewor k (Committer) <framework@example.org>
496 CommitDate: Thu Apr 7 15:15:13 2005 -0700
498 file 6
500 commit 2849f113c66cbf3c9521e90be3bc7e39fce8db16
501 Reflog: linked@{6} (Fra mewor k (Committer) <framework@example.org>)
502 Reflog message:
503 Author: Te s t (Author) <test@example.net>
504 AuthorDate: Thu Apr 7 15:14:13 2005 -0700
505 Commit: Fra mewor k (Committer) <framework@example.org>
506 CommitDate: Thu Apr 7 15:14:13 2005 -0700
508 file 7
510 commit fce870c7720ff513ea5dd3c60d6972ed70c41d1f
511 Reflog: linked@{7} (Fra mewor k (Committer) <framework@example.org>)
512 Reflog message:
513 Author: Te s t (Author) <test@example.net>
514 AuthorDate: Thu Apr 7 15:13:13 2005 -0700
515 Commit: Fra mewor k (Committer) <framework@example.org>
516 CommitDate: Thu Apr 7 15:13:13 2005 -0700
518 empty linked
521 test "$test_hash_algo" != "sha256" ||
522 cat <<\EOT >HEAD_main.log || die
523 commit e784e427bc756c7dab3c5c993ce172605b03911f4a4cee2b472f5eaf47439f1f
524 Reflog: HEAD@{0} (Fra mewor k (Committer) <framework@example.org>)
525 Reflog message: attaching back to c7
526 Author: Te s t (Author) <test@example.net>
527 AuthorDate: Thu Apr 7 15:20:13 2005 -0700
528 Commit: Fra mewor k (Committer) <framework@example.org>
529 CommitDate: Thu Apr 7 15:20:13 2005 -0700
531 file 7
533 commit e2552eeb08597fac52b221ecdcdda3d73b298adf066bd68a75e6d78b5c3ae0a8
534 Reflog: HEAD@{1} (Fra mewor k (Committer) <framework@example.org>)
535 Reflog message: detaching to c4
536 Author: Te s t (Author) <test@example.net>
537 AuthorDate: Thu Apr 7 15:17:13 2005 -0700
538 Commit: Fra mewor k (Committer) <framework@example.org>
539 CommitDate: Thu Apr 7 15:17:13 2005 -0700
541 file 4
543 commit e784e427bc756c7dab3c5c993ce172605b03911f4a4cee2b472f5eaf47439f1f
544 Reflog: HEAD@{2} (Fra mewor k (Committer) <framework@example.org>)
545 Reflog message:
546 Author: Te s t (Author) <test@example.net>
547 AuthorDate: Thu Apr 7 15:20:13 2005 -0700
548 Commit: Fra mewor k (Committer) <framework@example.org>
549 CommitDate: Thu Apr 7 15:20:13 2005 -0700
551 file 7
553 commit 201a80d1dac354e3bf8f5ffd8d6ed3bf45425d25903e51c5b5fe581ed1915b2b
554 Reflog: HEAD@{3} (Fra mewor k (Committer) <framework@example.org>)
555 Reflog message:
556 Author: Te s t (Author) <test@example.net>
557 AuthorDate: Thu Apr 7 15:19:13 2005 -0700
558 Commit: Fra mewor k (Committer) <framework@example.org>
559 CommitDate: Thu Apr 7 15:19:13 2005 -0700
561 file 6
563 commit 71acff480527a965010d8d59c50ed31ccff26637eb259ecd29aeb48f90dbcbd6
564 Reflog: HEAD@{4} (Fra mewor k (Committer) <framework@example.org>)
565 Reflog message:
566 Author: Te s t (Author) <test@example.net>
567 AuthorDate: Thu Apr 7 15:18:13 2005 -0700
568 Commit: Fra mewor k (Committer) <framework@example.org>
569 CommitDate: Thu Apr 7 15:18:13 2005 -0700
571 file 5
573 commit e2552eeb08597fac52b221ecdcdda3d73b298adf066bd68a75e6d78b5c3ae0a8
574 Reflog: HEAD@{5} (Fra mewor k (Committer) <framework@example.org>)
575 Reflog message:
576 Author: Te s t (Author) <test@example.net>
577 AuthorDate: Thu Apr 7 15:17:13 2005 -0700
578 Commit: Fra mewor k (Committer) <framework@example.org>
579 CommitDate: Thu Apr 7 15:17:13 2005 -0700
581 file 4
583 commit 196f1299c911ab944da342f5df818d2c930c84a6efecf6ab73e074abec73aa1c
584 Reflog: HEAD@{6} (Fra mewor k (Committer) <framework@example.org>)
585 Reflog message:
586 Author: Te s t (Author) <test@example.net>
587 AuthorDate: Thu Apr 7 15:16:13 2005 -0700
588 Commit: Fra mewor k (Committer) <framework@example.org>
589 CommitDate: Thu Apr 7 15:16:13 2005 -0700
591 file 3
593 commit 7dec28d627784a76bef56727ce0da16f78c9bf93c4ee21d63c26bfe19aec525b
594 Reflog: HEAD@{7} (Fra mewor k (Committer) <framework@example.org>)
595 Reflog message:
596 Author: Te s t (Author) <test@example.net>
597 AuthorDate: Thu Apr 7 15:15:13 2005 -0700
598 Commit: Fra mewor k (Committer) <framework@example.org>
599 CommitDate: Thu Apr 7 15:15:13 2005 -0700
601 file 2
603 commit ecf5cd744123c8f322d61b4a97d18d75f1c25440ca838a9654decff6b8697226
604 Reflog: HEAD@{8} (Fra mewor k (Committer) <framework@example.org>)
605 Reflog message:
606 Author: Te s t (Author) <test@example.net>
607 AuthorDate: Thu Apr 7 15:14:13 2005 -0700
608 Commit: Fra mewor k (Committer) <framework@example.org>
609 CommitDate: Thu Apr 7 15:14:13 2005 -0700
611 file 1
613 commit 079309f2fa99f1dc84e7d2b40b25766e2e6ff4da86bc8f2be31487085cc9359a
614 Reflog: HEAD@{9} (Fra mewor k (Committer) <framework@example.org>)
615 Reflog message:
616 Author: Te s t (Author) <test@example.net>
617 AuthorDate: Thu Apr 7 15:13:13 2005 -0700
618 Commit: Fra mewor k (Committer) <framework@example.org>
619 CommitDate: Thu Apr 7 15:13:13 2005 -0700
621 empty
624 test "$test_hash_algo" != "sha256" ||
625 cat <<\EOT >HEAD_linked.log || die
626 commit 6fda165d8aaa203d2bf9a67dcd750ac6e273489ea89e174866c1170d81cf2f73
627 Reflog: HEAD@{0} (Fra mewor k (Committer) <framework@example.org>)
628 Reflog message: attaching back to linked c1
629 Author: Te s t (Author) <test@example.net>
630 AuthorDate: Thu Apr 7 15:20:13 2005 -0700
631 Commit: Fra mewor k (Committer) <framework@example.org>
632 CommitDate: Thu Apr 7 15:20:13 2005 -0700
634 file 1
636 commit e2552eeb08597fac52b221ecdcdda3d73b298adf066bd68a75e6d78b5c3ae0a8
637 Reflog: HEAD@{1} (Fra mewor k (Committer) <framework@example.org>)
638 Reflog message: detaching to linked c4
639 Author: Te s t (Author) <test@example.net>
640 AuthorDate: Thu Apr 7 15:17:13 2005 -0700
641 Commit: Fra mewor k (Committer) <framework@example.org>
642 CommitDate: Thu Apr 7 15:17:13 2005 -0700
644 file 4
646 commit 6fda165d8aaa203d2bf9a67dcd750ac6e273489ea89e174866c1170d81cf2f73
647 Reflog: HEAD@{2} (Fra mewor k (Committer) <framework@example.org>)
648 Reflog message:
649 Author: Te s t (Author) <test@example.net>
650 AuthorDate: Thu Apr 7 15:20:13 2005 -0700
651 Commit: Fra mewor k (Committer) <framework@example.org>
652 CommitDate: Thu Apr 7 15:20:13 2005 -0700
654 file 1
656 commit 1a6140d409f963b95143d6d2ca04ceb547c798938ddac9e34f4be143c3de2e0e
657 Reflog: HEAD@{3} (Fra mewor k (Committer) <framework@example.org>)
658 Reflog message:
659 Author: Te s t (Author) <test@example.net>
660 AuthorDate: Thu Apr 7 15:19:13 2005 -0700
661 Commit: Fra mewor k (Committer) <framework@example.org>
662 CommitDate: Thu Apr 7 15:19:13 2005 -0700
664 file 2
666 commit a45e681849307b92993a9798ae71198df602a16281a29810fc1180139e426e89
667 Reflog: HEAD@{4} (Fra mewor k (Committer) <framework@example.org>)
668 Reflog message:
669 Author: Te s t (Author) <test@example.net>
670 AuthorDate: Thu Apr 7 15:18:13 2005 -0700
671 Commit: Fra mewor k (Committer) <framework@example.org>
672 CommitDate: Thu Apr 7 15:18:13 2005 -0700
674 file 3
676 commit e2552eeb08597fac52b221ecdcdda3d73b298adf066bd68a75e6d78b5c3ae0a8
677 Reflog: HEAD@{5} (Fra mewor k (Committer) <framework@example.org>)
678 Reflog message:
679 Author: Te s t (Author) <test@example.net>
680 AuthorDate: Thu Apr 7 15:17:13 2005 -0700
681 Commit: Fra mewor k (Committer) <framework@example.org>
682 CommitDate: Thu Apr 7 15:17:13 2005 -0700
684 file 4
686 commit 8575f83fcc048762d2e22aebed05a05bc0d7bada62665eacf83fbff2afb88a7a
687 Reflog: HEAD@{6} (Fra mewor k (Committer) <framework@example.org>)
688 Reflog message:
689 Author: Te s t (Author) <test@example.net>
690 AuthorDate: Thu Apr 7 15:16:13 2005 -0700
691 Commit: Fra mewor k (Committer) <framework@example.org>
692 CommitDate: Thu Apr 7 15:16:13 2005 -0700
694 file 5
696 commit 821fd1740f7c0903282e1f7e16b90891732f6f1480dd997591462a4514cc1d5a
697 Reflog: HEAD@{7} (Fra mewor k (Committer) <framework@example.org>)
698 Reflog message:
699 Author: Te s t (Author) <test@example.net>
700 AuthorDate: Thu Apr 7 15:15:13 2005 -0700
701 Commit: Fra mewor k (Committer) <framework@example.org>
702 CommitDate: Thu Apr 7 15:15:13 2005 -0700
704 file 6
706 commit e2473e861fd48f0ece81fdbd760dde169c6e00c57b426f85853b59203760214b
707 Reflog: HEAD@{8} (Fra mewor k (Committer) <framework@example.org>)
708 Reflog message:
709 Author: Te s t (Author) <test@example.net>
710 AuthorDate: Thu Apr 7 15:14:13 2005 -0700
711 Commit: Fra mewor k (Committer) <framework@example.org>
712 CommitDate: Thu Apr 7 15:14:13 2005 -0700
714 file 7
716 commit a6345fe47a02ec4a2f0f5b749104a44dddff871fcea90b2525b0a5eb1af946e2
717 Reflog: HEAD@{9} (Fra mewor k (Committer) <framework@example.org>)
718 Reflog message:
719 Author: Te s t (Author) <test@example.net>
720 AuthorDate: Thu Apr 7 15:13:13 2005 -0700
721 Commit: Fra mewor k (Committer) <framework@example.org>
722 CommitDate: Thu Apr 7 15:13:13 2005 -0700
724 empty linked
727 test "$test_hash_algo" != "sha256" ||
728 cat <<\EOT >master.log
729 commit e784e427bc756c7dab3c5c993ce172605b03911f4a4cee2b472f5eaf47439f1f
730 Reflog: master@{0} (Fra mewor k (Committer) <framework@example.org>)
731 Reflog message:
732 Author: Te s t (Author) <test@example.net>
733 AuthorDate: Thu Apr 7 15:20:13 2005 -0700
734 Commit: Fra mewor k (Committer) <framework@example.org>
735 CommitDate: Thu Apr 7 15:20:13 2005 -0700
737 file 7
739 commit 201a80d1dac354e3bf8f5ffd8d6ed3bf45425d25903e51c5b5fe581ed1915b2b
740 Reflog: master@{1} (Fra mewor k (Committer) <framework@example.org>)
741 Reflog message:
742 Author: Te s t (Author) <test@example.net>
743 AuthorDate: Thu Apr 7 15:19:13 2005 -0700
744 Commit: Fra mewor k (Committer) <framework@example.org>
745 CommitDate: Thu Apr 7 15:19:13 2005 -0700
747 file 6
749 commit 71acff480527a965010d8d59c50ed31ccff26637eb259ecd29aeb48f90dbcbd6
750 Reflog: master@{2} (Fra mewor k (Committer) <framework@example.org>)
751 Reflog message:
752 Author: Te s t (Author) <test@example.net>
753 AuthorDate: Thu Apr 7 15:18:13 2005 -0700
754 Commit: Fra mewor k (Committer) <framework@example.org>
755 CommitDate: Thu Apr 7 15:18:13 2005 -0700
757 file 5
759 commit e2552eeb08597fac52b221ecdcdda3d73b298adf066bd68a75e6d78b5c3ae0a8
760 Reflog: master@{3} (Fra mewor k (Committer) <framework@example.org>)
761 Reflog message:
762 Author: Te s t (Author) <test@example.net>
763 AuthorDate: Thu Apr 7 15:17:13 2005 -0700
764 Commit: Fra mewor k (Committer) <framework@example.org>
765 CommitDate: Thu Apr 7 15:17:13 2005 -0700
767 file 4
769 commit 196f1299c911ab944da342f5df818d2c930c84a6efecf6ab73e074abec73aa1c
770 Reflog: master@{4} (Fra mewor k (Committer) <framework@example.org>)
771 Reflog message:
772 Author: Te s t (Author) <test@example.net>
773 AuthorDate: Thu Apr 7 15:16:13 2005 -0700
774 Commit: Fra mewor k (Committer) <framework@example.org>
775 CommitDate: Thu Apr 7 15:16:13 2005 -0700
777 file 3
779 commit 7dec28d627784a76bef56727ce0da16f78c9bf93c4ee21d63c26bfe19aec525b
780 Reflog: master@{5} (Fra mewor k (Committer) <framework@example.org>)
781 Reflog message:
782 Author: Te s t (Author) <test@example.net>
783 AuthorDate: Thu Apr 7 15:15:13 2005 -0700
784 Commit: Fra mewor k (Committer) <framework@example.org>
785 CommitDate: Thu Apr 7 15:15:13 2005 -0700
787 file 2
789 commit ecf5cd744123c8f322d61b4a97d18d75f1c25440ca838a9654decff6b8697226
790 Reflog: master@{6} (Fra mewor k (Committer) <framework@example.org>)
791 Reflog message:
792 Author: Te s t (Author) <test@example.net>
793 AuthorDate: Thu Apr 7 15:14:13 2005 -0700
794 Commit: Fra mewor k (Committer) <framework@example.org>
795 CommitDate: Thu Apr 7 15:14:13 2005 -0700
797 file 1
799 commit 079309f2fa99f1dc84e7d2b40b25766e2e6ff4da86bc8f2be31487085cc9359a
800 Reflog: master@{7} (Fra mewor k (Committer) <framework@example.org>)
801 Reflog message:
802 Author: Te s t (Author) <test@example.net>
803 AuthorDate: Thu Apr 7 15:13:13 2005 -0700
804 Commit: Fra mewor k (Committer) <framework@example.org>
805 CommitDate: Thu Apr 7 15:13:13 2005 -0700
807 empty
810 test "$test_hash_algo" != "sha256" ||
811 cat <<\EOT >linked.log
812 commit 6fda165d8aaa203d2bf9a67dcd750ac6e273489ea89e174866c1170d81cf2f73
813 Reflog: linked@{0} (Fra mewor k (Committer) <framework@example.org>)
814 Reflog message:
815 Author: Te s t (Author) <test@example.net>
816 AuthorDate: Thu Apr 7 15:20:13 2005 -0700
817 Commit: Fra mewor k (Committer) <framework@example.org>
818 CommitDate: Thu Apr 7 15:20:13 2005 -0700
820 file 1
822 commit 1a6140d409f963b95143d6d2ca04ceb547c798938ddac9e34f4be143c3de2e0e
823 Reflog: linked@{1} (Fra mewor k (Committer) <framework@example.org>)
824 Reflog message:
825 Author: Te s t (Author) <test@example.net>
826 AuthorDate: Thu Apr 7 15:19:13 2005 -0700
827 Commit: Fra mewor k (Committer) <framework@example.org>
828 CommitDate: Thu Apr 7 15:19:13 2005 -0700
830 file 2
832 commit a45e681849307b92993a9798ae71198df602a16281a29810fc1180139e426e89
833 Reflog: linked@{2} (Fra mewor k (Committer) <framework@example.org>)
834 Reflog message:
835 Author: Te s t (Author) <test@example.net>
836 AuthorDate: Thu Apr 7 15:18:13 2005 -0700
837 Commit: Fra mewor k (Committer) <framework@example.org>
838 CommitDate: Thu Apr 7 15:18:13 2005 -0700
840 file 3
842 commit e2552eeb08597fac52b221ecdcdda3d73b298adf066bd68a75e6d78b5c3ae0a8
843 Reflog: linked@{3} (Fra mewor k (Committer) <framework@example.org>)
844 Reflog message:
845 Author: Te s t (Author) <test@example.net>
846 AuthorDate: Thu Apr 7 15:17:13 2005 -0700
847 Commit: Fra mewor k (Committer) <framework@example.org>
848 CommitDate: Thu Apr 7 15:17:13 2005 -0700
850 file 4
852 commit 8575f83fcc048762d2e22aebed05a05bc0d7bada62665eacf83fbff2afb88a7a
853 Reflog: linked@{4} (Fra mewor k (Committer) <framework@example.org>)
854 Reflog message:
855 Author: Te s t (Author) <test@example.net>
856 AuthorDate: Thu Apr 7 15:16:13 2005 -0700
857 Commit: Fra mewor k (Committer) <framework@example.org>
858 CommitDate: Thu Apr 7 15:16:13 2005 -0700
860 file 5
862 commit 821fd1740f7c0903282e1f7e16b90891732f6f1480dd997591462a4514cc1d5a
863 Reflog: linked@{5} (Fra mewor k (Committer) <framework@example.org>)
864 Reflog message:
865 Author: Te s t (Author) <test@example.net>
866 AuthorDate: Thu Apr 7 15:15:13 2005 -0700
867 Commit: Fra mewor k (Committer) <framework@example.org>
868 CommitDate: Thu Apr 7 15:15:13 2005 -0700
870 file 6
872 commit e2473e861fd48f0ece81fdbd760dde169c6e00c57b426f85853b59203760214b
873 Reflog: linked@{6} (Fra mewor k (Committer) <framework@example.org>)
874 Reflog message:
875 Author: Te s t (Author) <test@example.net>
876 AuthorDate: Thu Apr 7 15:14:13 2005 -0700
877 Commit: Fra mewor k (Committer) <framework@example.org>
878 CommitDate: Thu Apr 7 15:14:13 2005 -0700
880 file 7
882 commit a6345fe47a02ec4a2f0f5b749104a44dddff871fcea90b2525b0a5eb1af946e2
883 Reflog: linked@{7} (Fra mewor k (Committer) <framework@example.org>)
884 Reflog message:
885 Author: Te s t (Author) <test@example.net>
886 AuthorDate: Thu Apr 7 15:13:13 2005 -0700
887 Commit: Fra mewor k (Committer) <framework@example.org>
888 CommitDate: Thu Apr 7 15:13:13 2005 -0700
890 empty linked
893 test_expect_success LASTOK 'verify setup' '
894 test -f "main/.git/objects/pack/$objpack.idx" &&
895 test -f "main/.git/objects/pack/$objpack.pack" &&
896 cd main &&
897 mv -f ".git/objects/pack/$objpack.idx" ".git/objects/pack/$objpack.no" &&
898 test_must_fail git fsck --full &&
899 mv -f ".git/objects/pack/$objpack.no" ".git/objects/pack/$objpack.idx" &&
900 git fsck --full &&
901 git log -g --pretty=fuller HEAD >actual &&
902 test_cmp actual ../HEAD_main.log &&
903 git log -g --pretty=fuller master >actual &&
904 test_cmp actual ../master.log &&
905 if test_have_prereq GIT_2_5; then
906 cd ../linked &&
907 git log -g --pretty=fuller HEAD >actual &&
908 test_cmp actual ../HEAD_linked.log &&
909 git log -g --pretty=fuller linked >actual &&
910 test_cmp actual ../linked.log
911 fi &&
912 test_when_finished test_set_prereq SETUP
915 test "$test_hash_algo" != "sha1" ||
916 cat <<\EOT >tgHEAD_main.log || die
917 === 2005-04-07 ===
918 dd1016e3 15:20:13 (commit) HEAD@{0}: attaching back to c7
919 40403e00 15:20:13 (commit) HEAD@{1}: detaching to c4
920 dd1016e3 15:20:13 (commit) HEAD@{2}: file 7
921 84b1e4e6 15:19:13 (commit) HEAD@{3}: file 6
922 8238c7e7 15:18:13 (commit) HEAD@{4}: file 5
923 40403e00 15:17:13 (commit) HEAD@{5}: file 4
924 feeb764a 15:16:13 (commit) HEAD@{6}: file 3
925 c0ed6e70 15:15:13 (commit) HEAD@{7}: file 2
926 c18fcef2 15:14:13 (commit) HEAD@{8}: file 1
927 b63866e5 15:13:13 (commit) HEAD@{9}: empty
930 test "$test_hash_algo" != "sha256" ||
931 cat <<\EOT >tgHEAD_main.log || die
932 === 2005-04-07 ===
933 e784e427 15:20:13 (commit) HEAD@{0}: attaching back to c7
934 e2552eeb 15:20:13 (commit) HEAD@{1}: detaching to c4
935 e784e427 15:20:13 (commit) HEAD@{2}: file 7
936 201a80d1 15:19:13 (commit) HEAD@{3}: file 6
937 71acff48 15:18:13 (commit) HEAD@{4}: file 5
938 e2552eeb 15:17:13 (commit) HEAD@{5}: file 4
939 196f1299 15:16:13 (commit) HEAD@{6}: file 3
940 7dec28d6 15:15:13 (commit) HEAD@{7}: file 2
941 ecf5cd74 15:14:13 (commit) HEAD@{8}: file 1
942 079309f2 15:13:13 (commit) HEAD@{9}: empty
945 test_expect_success SETUP 'tag -g HEAD' '
946 cd main &&
947 tg tag -g HEAD >actual &&
948 test_cmp actual ../tgHEAD_main.log
951 test_expect_success SETUP 'tag -g --no-type HEAD' '
952 cd main &&
953 sed "s/(commit) //" <../tgHEAD_main.log >expected &&
954 tg tag -g --no-type HEAD >actual &&
955 test_cmp actual expected
958 test "$test_hash_algo" != "sha1" ||
959 cat <<\EOT >tgmaster.log || die
960 === 2005-04-07 ===
961 dd1016e3 15:20:13 (commit) master@{0}: file 7
962 84b1e4e6 15:19:13 (commit) master@{1}: file 6
963 8238c7e7 15:18:13 (commit) master@{2}: file 5
964 40403e00 15:17:13 (commit) master@{3}: file 4
965 feeb764a 15:16:13 (commit) master@{4}: file 3
966 c0ed6e70 15:15:13 (commit) master@{5}: file 2
967 c18fcef2 15:14:13 (commit) master@{6}: file 1
968 b63866e5 15:13:13 (commit) master@{7}: empty
971 test "$test_hash_algo" != "sha256" ||
972 cat <<\EOT >tgmaster.log || die
973 === 2005-04-07 ===
974 e784e427 15:20:13 (commit) master@{0}: file 7
975 201a80d1 15:19:13 (commit) master@{1}: file 6
976 71acff48 15:18:13 (commit) master@{2}: file 5
977 e2552eeb 15:17:13 (commit) master@{3}: file 4
978 196f1299 15:16:13 (commit) master@{4}: file 3
979 7dec28d6 15:15:13 (commit) master@{5}: file 2
980 ecf5cd74 15:14:13 (commit) master@{6}: file 1
981 079309f2 15:13:13 (commit) master@{7}: empty
984 test_expect_success SETUP 'tag -g master' '
985 cd main &&
986 tg tag -g master >actual &&
987 test_cmp actual ../tgmaster.log
990 test_expect_success SETUP 'tag -g --no-type master' '
991 cd main &&
992 sed "s/(commit) //" <../tgmaster.log >expected &&
993 tg tag -g --no-type master >actual &&
994 test_cmp actual expected
997 test_expect_success SETUP 'rev-parse --verify master@{0..7}' '
998 cd main &&
999 test_must_fail git rev-parse --verify master@{8} -- &&
1000 case "$test_hash_algo" in
1001 sha1)
1002 test_cmp_rev b63866e5 master@{7} &&
1003 test_cmp_rev c18fcef2 master@{6} &&
1004 test_cmp_rev c0ed6e70 master@{5} &&
1005 test_cmp_rev feeb764a master@{4} &&
1006 test_cmp_rev 40403e00 master@{3} &&
1007 test_cmp_rev 8238c7e7 master@{2} &&
1008 test_cmp_rev 84b1e4e6 master@{1} &&
1009 test_cmp_rev dd1016e3 master@{0}
1011 sha256)
1012 test_cmp_rev 079309f2 master@{7} &&
1013 test_cmp_rev ecf5cd74 master@{6} &&
1014 test_cmp_rev 7dec28d6 master@{5} &&
1015 test_cmp_rev 196f1299 master@{4} &&
1016 test_cmp_rev e2552eeb master@{3} &&
1017 test_cmp_rev 71acff48 master@{2} &&
1018 test_cmp_rev 201a80d1 master@{1} &&
1019 test_cmp_rev e784e427 master@{0}
1020 ;;*) die unknown hash "$test_hash_algo"
1021 esac &&
1022 test_cmp_rev master master@{0}
1025 test "$test_hash_algo" != "sha1" ||
1026 cat <<\EOT >tgHEAD_linked.log || die
1027 === 2005-04-07 ===
1028 04eea982 15:20:13 (commit) HEAD@{0}: attaching back to linked c1
1029 40403e00 15:20:13 (commit) HEAD@{1}: detaching to linked c4
1030 04eea982 15:20:13 (commit) HEAD@{2}: file 1
1031 4d776c64 15:19:13 (commit) HEAD@{3}: file 2
1032 602d59a7 15:18:13 (commit) HEAD@{4}: file 3
1033 40403e00 15:17:13 (commit) HEAD@{5}: file 4
1034 0a45d475 15:16:13 (commit) HEAD@{6}: file 5
1035 e053b7d1 15:15:13 (commit) HEAD@{7}: file 6
1036 2849f113 15:14:13 (commit) HEAD@{8}: file 7
1037 fce870c7 15:13:13 (commit) HEAD@{9}: empty linked
1040 test "$test_hash_algo" != "sha256" ||
1041 cat <<\EOT >tgHEAD_linked.log || die
1042 === 2005-04-07 ===
1043 6fda165d 15:20:13 (commit) HEAD@{0}: attaching back to linked c1
1044 e2552eeb 15:20:13 (commit) HEAD@{1}: detaching to linked c4
1045 6fda165d 15:20:13 (commit) HEAD@{2}: file 1
1046 1a6140d4 15:19:13 (commit) HEAD@{3}: file 2
1047 a45e6818 15:18:13 (commit) HEAD@{4}: file 3
1048 e2552eeb 15:17:13 (commit) HEAD@{5}: file 4
1049 8575f83f 15:16:13 (commit) HEAD@{6}: file 5
1050 821fd174 15:15:13 (commit) HEAD@{7}: file 6
1051 e2473e86 15:14:13 (commit) HEAD@{8}: file 7
1052 a6345fe4 15:13:13 (commit) HEAD@{9}: empty linked
1055 test_expect_success 'SETUP GIT_2_5' 'tag -g HEAD [linked]' '
1056 cd linked &&
1057 tg tag -g HEAD >actual &&
1058 test_cmp actual ../tgHEAD_linked.log
1061 test_expect_success 'SETUP GIT_2_5' 'tag -g --no-type HEAD [linked]' '
1062 cd linked &&
1063 sed "s/(commit) //" <../tgHEAD_linked.log >expected &&
1064 tg tag -g --no-type HEAD >actual &&
1065 test_cmp actual expected
1068 test "$test_hash_algo" != "sha1" ||
1069 cat <<\EOT >tglinked.log || die
1070 === 2005-04-07 ===
1071 04eea982 15:20:13 (commit) linked@{0}: file 1
1072 4d776c64 15:19:13 (commit) linked@{1}: file 2
1073 602d59a7 15:18:13 (commit) linked@{2}: file 3
1074 40403e00 15:17:13 (commit) linked@{3}: file 4
1075 0a45d475 15:16:13 (commit) linked@{4}: file 5
1076 e053b7d1 15:15:13 (commit) linked@{5}: file 6
1077 2849f113 15:14:13 (commit) linked@{6}: file 7
1078 fce870c7 15:13:13 (commit) linked@{7}: empty linked
1081 test "$test_hash_algo" != "sha256" ||
1082 cat <<\EOT >tglinked.log || die
1083 === 2005-04-07 ===
1084 6fda165d 15:20:13 (commit) linked@{0}: file 1
1085 1a6140d4 15:19:13 (commit) linked@{1}: file 2
1086 a45e6818 15:18:13 (commit) linked@{2}: file 3
1087 e2552eeb 15:17:13 (commit) linked@{3}: file 4
1088 8575f83f 15:16:13 (commit) linked@{4}: file 5
1089 821fd174 15:15:13 (commit) linked@{5}: file 6
1090 e2473e86 15:14:13 (commit) linked@{6}: file 7
1091 a6345fe4 15:13:13 (commit) linked@{7}: empty linked
1094 test_expect_success 'SETUP GIT_2_5' 'tag -g linked' '
1095 cd linked &&
1096 tg tag -g linked >actual &&
1097 test_cmp actual ../tglinked.log &&
1098 cd ../main &&
1099 tg tag -g linked >actual &&
1100 test_cmp actual ../tglinked.log
1103 test_expect_success 'SETUP GIT_2_5' 'tag --no-type -g linked' '
1104 cd linked &&
1105 sed "s/(commit) //" <../tglinked.log >expected &&
1106 tg tag -g --no-type linked >actual &&
1107 test_cmp actual expected &&
1108 cd ../main &&
1109 tg tag -g --no-type linked >actual &&
1110 test_cmp actual ../linked/expected
1113 test_expect_success 'SETUP GIT_2_5' 'rev-parse --verify linked@{0..7}' '
1114 cd linked &&
1115 test_must_fail git rev-parse --verify linked@{8} -- &&
1116 case "$test_hash_algo" in
1117 sha1)
1118 test_cmp_rev fce870c7 linked@{7} &&
1119 test_cmp_rev 2849f113 linked@{6} &&
1120 test_cmp_rev e053b7d1 linked@{5} &&
1121 test_cmp_rev 0a45d475 linked@{4} &&
1122 test_cmp_rev 40403e00 linked@{3} &&
1123 test_cmp_rev 602d59a7 linked@{2} &&
1124 test_cmp_rev 4d776c64 linked@{1} &&
1125 test_cmp_rev 04eea982 linked@{0}
1127 sha256)
1128 test_cmp_rev a6345fe4 linked@{7} &&
1129 test_cmp_rev e2473e86 linked@{6} &&
1130 test_cmp_rev 821fd174 linked@{5} &&
1131 test_cmp_rev 8575f83f linked@{4} &&
1132 test_cmp_rev e2552eeb linked@{3} &&
1133 test_cmp_rev a45e6818 linked@{2} &&
1134 test_cmp_rev 1a6140d4 linked@{1} &&
1135 test_cmp_rev 6fda165d linked@{0}
1136 ;;*) die unknown hash "$test_hash_algo"
1137 esac &&
1138 test_cmp_rev linked linked@{0}
1141 test "$test_hash_algo" != "sha1" ||
1142 cat <<\EOT >tgHEAD_main_1.log || die
1143 === 2005-04-07 ===
1144 dd1016e3 15:20:13 (commit) HEAD@{0}: attaching back to c7
1145 dd1016e3 15:20:13 (commit) HEAD@{1}: file 7
1146 84b1e4e6 15:19:13 (commit) HEAD@{2}: file 6
1147 8238c7e7 15:18:13 (commit) HEAD@{3}: file 5
1148 40403e00 15:17:13 (commit) HEAD@{4}: file 4
1149 feeb764a 15:16:13 (commit) HEAD@{5}: file 3
1150 c0ed6e70 15:15:13 (commit) HEAD@{6}: file 2
1151 c18fcef2 15:14:13 (commit) HEAD@{7}: file 1
1152 b63866e5 15:13:13 (commit) HEAD@{8}: empty
1155 test "$test_hash_algo" != "sha256" ||
1156 cat <<\EOT >tgHEAD_main_1.log || die
1157 === 2005-04-07 ===
1158 e784e427 15:20:13 (commit) HEAD@{0}: attaching back to c7
1159 e784e427 15:20:13 (commit) HEAD@{1}: file 7
1160 201a80d1 15:19:13 (commit) HEAD@{2}: file 6
1161 71acff48 15:18:13 (commit) HEAD@{3}: file 5
1162 e2552eeb 15:17:13 (commit) HEAD@{4}: file 4
1163 196f1299 15:16:13 (commit) HEAD@{5}: file 3
1164 7dec28d6 15:15:13 (commit) HEAD@{6}: file 2
1165 ecf5cd74 15:14:13 (commit) HEAD@{7}: file 1
1166 079309f2 15:13:13 (commit) HEAD@{8}: empty
1169 test_expect_success SETUP 'tag --drop HEAD@{1}' '
1170 cd main &&
1171 tg tag --drop HEAD@{1} &&
1172 tg tag -g HEAD >actual &&
1173 test_cmp actual ../tgHEAD_main_1.log
1176 test_expect_success SETUP 'tag --drop HEAD@{9} fails' '
1177 cd main &&
1178 test_must_fail tg tag --drop HEAD@{9}
1181 test_expect_success SETUP 'tag --drop HEAD@{8}' '
1182 cd main &&
1183 sed <../tgHEAD_main_1.log -n "1,9p" >expected &&
1184 tg tag --drop HEAD@{8} &&
1185 tg tag -g HEAD >actual &&
1186 test_cmp actual expected
1189 test "$test_hash_algo" != "sha1" ||
1190 cat <<\EOT >tgmaster_3.log || die
1191 === 2005-04-07 ===
1192 dd1016e3 15:20:13 (commit) master@{0}: file 7
1193 84b1e4e6 15:19:13 (commit) master@{1}: file 6
1194 8238c7e7 15:18:13 (commit) master@{2}: file 5
1195 feeb764a 15:16:13 (commit) master@{3}: file 3
1196 c0ed6e70 15:15:13 (commit) master@{4}: file 2
1197 c18fcef2 15:14:13 (commit) master@{5}: file 1
1198 b63866e5 15:13:13 (commit) master@{6}: empty
1201 test "$test_hash_algo" != "sha256" ||
1202 cat <<\EOT >tgmaster_3.log || die
1203 === 2005-04-07 ===
1204 e784e427 15:20:13 (commit) master@{0}: file 7
1205 201a80d1 15:19:13 (commit) master@{1}: file 6
1206 71acff48 15:18:13 (commit) master@{2}: file 5
1207 196f1299 15:16:13 (commit) master@{3}: file 3
1208 7dec28d6 15:15:13 (commit) master@{4}: file 2
1209 ecf5cd74 15:14:13 (commit) master@{5}: file 1
1210 079309f2 15:13:13 (commit) master@{6}: empty
1213 test_expect_success SETUP 'tag --drop master@{3}' '
1214 cd main &&
1215 tg tag --drop master@{3} &&
1216 tg tag -g master >actual &&
1217 test_cmp actual ../tgmaster_3.log
1220 test_expect_success SETUP 'tag --drop master@{7} fails' '
1221 cd main &&
1222 test_must_fail tg tag --drop master@{7}
1225 test_expect_success SETUP 'tag --drop master@{6}' '
1226 cd main &&
1227 sed <../tgmaster_3.log -n "1,7p" >expected &&
1228 tg tag --drop master@{6} &&
1229 tg tag -g master >actual &&
1230 test_cmp actual expected
1233 test "$test_hash_algo" != "sha1" ||
1234 cat <<\EOT >tgHEAD_linked_1.log || die
1235 === 2005-04-07 ===
1236 04eea982 15:20:13 (commit) HEAD@{0}: attaching back to linked c1
1237 04eea982 15:20:13 (commit) HEAD@{1}: file 1
1238 4d776c64 15:19:13 (commit) HEAD@{2}: file 2
1239 602d59a7 15:18:13 (commit) HEAD@{3}: file 3
1240 40403e00 15:17:13 (commit) HEAD@{4}: file 4
1241 0a45d475 15:16:13 (commit) HEAD@{5}: file 5
1242 e053b7d1 15:15:13 (commit) HEAD@{6}: file 6
1243 2849f113 15:14:13 (commit) HEAD@{7}: file 7
1244 fce870c7 15:13:13 (commit) HEAD@{8}: empty linked
1247 test "$test_hash_algo" != "sha256" ||
1248 cat <<\EOT >tgHEAD_linked_1.log || die
1249 === 2005-04-07 ===
1250 6fda165d 15:20:13 (commit) HEAD@{0}: attaching back to linked c1
1251 6fda165d 15:20:13 (commit) HEAD@{1}: file 1
1252 1a6140d4 15:19:13 (commit) HEAD@{2}: file 2
1253 a45e6818 15:18:13 (commit) HEAD@{3}: file 3
1254 e2552eeb 15:17:13 (commit) HEAD@{4}: file 4
1255 8575f83f 15:16:13 (commit) HEAD@{5}: file 5
1256 821fd174 15:15:13 (commit) HEAD@{6}: file 6
1257 e2473e86 15:14:13 (commit) HEAD@{7}: file 7
1258 a6345fe4 15:13:13 (commit) HEAD@{8}: empty linked
1261 test_expect_success 'SETUP GIT_2_5' 'tag --drop HEAD@{1} [linked]' '
1262 cd linked &&
1263 tg tag --drop HEAD@{1} &&
1264 tg tag -g HEAD >actual &&
1265 test_cmp actual ../tgHEAD_linked_1.log
1268 test_expect_success 'SETUP GIT_2_5' 'tag --drop HEAD@{9} [linked] fails' '
1269 cd linked &&
1270 test_must_fail tg tag --drop HEAD@{9}
1273 test_expect_success 'SETUP GIT_2_5' 'tag --drop HEAD@{8} [linked]' '
1274 cd linked &&
1275 sed <../tgHEAD_linked_1.log -n "1,9p" >expected &&
1276 tg tag --drop HEAD@{8} &&
1277 tg tag -g HEAD >actual &&
1278 test_cmp actual expected
1281 test "$test_hash_algo" != "sha1" ||
1282 cat <<\EOT >tglinked_2.log || die
1283 === 2005-04-07 ===
1284 04eea982 15:20:13 (commit) linked@{0}: file 1
1285 4d776c64 15:19:13 (commit) linked@{1}: file 2
1286 40403e00 15:17:13 (commit) linked@{2}: file 4
1287 0a45d475 15:16:13 (commit) linked@{3}: file 5
1288 e053b7d1 15:15:13 (commit) linked@{4}: file 6
1289 2849f113 15:14:13 (commit) linked@{5}: file 7
1290 fce870c7 15:13:13 (commit) linked@{6}: empty linked
1293 test "$test_hash_algo" != "sha256" ||
1294 cat <<\EOT >tglinked_2.log || die
1295 === 2005-04-07 ===
1296 6fda165d 15:20:13 (commit) linked@{0}: file 1
1297 1a6140d4 15:19:13 (commit) linked@{1}: file 2
1298 e2552eeb 15:17:13 (commit) linked@{2}: file 4
1299 8575f83f 15:16:13 (commit) linked@{3}: file 5
1300 821fd174 15:15:13 (commit) linked@{4}: file 6
1301 e2473e86 15:14:13 (commit) linked@{5}: file 7
1302 a6345fe4 15:13:13 (commit) linked@{6}: empty linked
1305 test_expect_success 'SETUP GIT_2_5' 'tag --drop linked@{2}' '
1306 cd linked &&
1307 tg tag --drop linked@{2} &&
1308 tg tag -g linked >actual &&
1309 test_cmp actual ../tglinked_2.log
1312 test_expect_success 'SETUP GIT_2_5' 'tag --drop linked@{7} fails' '
1313 cd linked &&
1314 test_must_fail tg tag --drop linked@{7}
1317 test_expect_success 'SETUP GIT_2_5' 'tag --drop linked@{6}' '
1318 cd linked &&
1319 sed <../tglinked_2.log -n "1,7p" >expected &&
1320 tg tag --drop linked@{6} &&
1321 tg tag -g linked >actual &&
1322 test_cmp actual expected
1325 test_expect_success SETUP 'tag --drop master@{0}' '
1326 cd main &&
1327 m0="$(git rev-parse --verify master@{0})" && test -n "$m0" &&
1328 m1="$(git rev-parse --verify master@{1})" && test -n "$m1" &&
1329 m="$(git rev-parse --verify master)" && test -n "$m" &&
1330 test "$m" = "$m0" &&
1331 test "$m0" != "$m1" &&
1332 tg tag --drop master@{0} &&
1333 m0new="$(git rev-parse --verify master@{0})" && test -n "$m0new" &&
1334 mnew="$(git rev-parse --verify master)" && test -n "$mnew" &&
1335 test "$mnew" = "$m0new" &&
1336 test "$m0new" = "$m1"
1339 test_expect_success 'SETUP GIT_2_5' 'tag --drop linked@{0}' '
1340 cd linked &&
1341 l0="$(git rev-parse --verify linked@{0})" && test -n "$l0" &&
1342 l1="$(git rev-parse --verify linked@{1})" && test -n "$l1" &&
1343 l="$(git rev-parse --verify linked)" && test -n "$l" &&
1344 test "$l" = "$l0" &&
1345 test "$l0" != "$l1" &&
1346 tg tag --drop linked@{0} &&
1347 l0new="$(git rev-parse --verify linked@{0})" && test -n "$l0new" &&
1348 lnew="$(git rev-parse --verify linked)" && test -n "$lnew" &&
1349 test "$lnew" = "$l0new" &&
1350 test "$l0new" = "$l1"
1353 test_expect_success SETUP 'rev-parse --verify master@{0..4}' '
1354 cd main &&
1355 test_must_fail git rev-parse --verify master@{5} -- &&
1356 case "$test_hash_algo" in
1357 sha1)
1358 test_cmp_rev c18fcef2 master@{4} &&
1359 test_cmp_rev c0ed6e70 master@{3} &&
1360 test_cmp_rev feeb764a master@{2} &&
1361 test_cmp_rev 8238c7e7 master@{1} &&
1362 test_cmp_rev 84b1e4e6 master@{0}
1364 sha256)
1365 test_cmp_rev ecf5cd74 master@{4} &&
1366 test_cmp_rev 7dec28d6 master@{3} &&
1367 test_cmp_rev 196f1299 master@{2} &&
1368 test_cmp_rev 71acff48 master@{1} &&
1369 test_cmp_rev 201a80d1 master@{0}
1370 ;;*) die unknown hash "$test_hash_algo"
1371 esac &&
1372 test_cmp_rev master master@{0}
1375 test_expect_success 'SETUP GIT_2_5' 'rev-parse --verify linked@{0..4}' '
1376 cd linked &&
1377 test_must_fail git rev-parse --verify linked@{5} -- &&
1378 case "$test_hash_algo" in
1379 sha1)
1380 test_cmp_rev 2849f113 linked@{4} &&
1381 test_cmp_rev e053b7d1 linked@{3} &&
1382 test_cmp_rev 0a45d475 linked@{2} &&
1383 test_cmp_rev 40403e00 linked@{1} &&
1384 test_cmp_rev 4d776c64 linked@{0}
1386 sha256)
1387 test_cmp_rev e2473e86 linked@{4} &&
1388 test_cmp_rev 821fd174 linked@{3} &&
1389 test_cmp_rev 8575f83f linked@{2} &&
1390 test_cmp_rev e2552eeb linked@{1} &&
1391 test_cmp_rev 1a6140d4 linked@{0}
1392 ;;*) die unknown hash "$test_hash_algo"
1393 esac &&
1394 test_cmp_rev linked linked@{0}
1397 test_expect_success '!GIT_2_31 SETUP' 'tag --drop symref HEAD@{0}' '
1398 cd main &&
1399 h0="$(git rev-parse --verify HEAD@{0})" && test -n "$h0" &&
1400 h1="$(git rev-parse --verify HEAD@{1})" && test -n "$h1" &&
1401 h="$(git rev-parse --verify HEAD)" && test -n "$h" &&
1402 test "$h" = "$h0" &&
1403 test "$h0" != "$h1" &&
1404 tg tag --drop HEAD@{0} &&
1405 h0new="$(git rev-parse --verify HEAD@{0})" && test -n "$h0new" &&
1406 hnew="$(git rev-parse --verify HEAD)" && test -n "$hnew" &&
1407 test "$hnew" = "$h0new" &&
1408 test "$h0new" = "$h0"
1411 test_expect_success '!GIT_2_31 SETUP GIT_2_5' 'tag --drop symref HEAD@{0} [linked]' '
1412 cd linked &&
1413 h0="$(git rev-parse --verify HEAD@{0})" && test -n "$h0" &&
1414 h1="$(git rev-parse --verify HEAD@{1})" && test -n "$h1" &&
1415 h="$(git rev-parse --verify HEAD)" && test -n "$h" &&
1416 test "$h" = "$h0" &&
1417 test "$h0" != "$h1" &&
1418 tg tag --drop HEAD@{0} &&
1419 h0new="$(git rev-parse --verify HEAD@{0})" && test -n "$h0new" &&
1420 hnew="$(git rev-parse --verify HEAD)" && test -n "$hnew" &&
1421 test "$hnew" = "$h0new" &&
1422 test "$h0new" = "$h0"
1425 test_expect_success '!GIT_2_31 SETUP' 'tag --drop detached HEAD@{0}' '
1426 cd main &&
1427 git update-ref -m detach --no-deref HEAD HEAD HEAD &&
1428 h0="$(git rev-parse --verify HEAD@{0})" && test -n "$h0" &&
1429 h1="$(git rev-parse --verify HEAD@{1})" && test -n "$h1" &&
1430 h="$(git rev-parse --verify HEAD)" && test -n "$h" &&
1431 test "$h" = "$h0" &&
1432 test "$h0" != "$h1" &&
1433 tg tag --drop HEAD@{0} &&
1434 h0new="$(git rev-parse --verify HEAD@{0})" && test -n "$h0new" &&
1435 hnew="$(git rev-parse --verify HEAD)" && test -n "$hnew" &&
1436 test "$hnew" = "$h0new" &&
1437 test "$h0new" = "$h1"
1440 test_expect_success '!GIT_2_31 SETUP GIT_2_5' 'tag --drop detached HEAD@{0} [linked]' '
1441 cd linked &&
1442 git update-ref -m detach --no-deref HEAD HEAD HEAD &&
1443 h0="$(git rev-parse --verify HEAD@{0})" && test -n "$h0" &&
1444 h1="$(git rev-parse --verify HEAD@{1})" && test -n "$h1" &&
1445 h="$(git rev-parse --verify HEAD)" && test -n "$h" &&
1446 test "$h" = "$h0" &&
1447 test "$h0" != "$h1" &&
1448 tg tag --drop HEAD@{0} &&
1449 h0new="$(git rev-parse --verify HEAD@{0})" && test -n "$h0new" &&
1450 hnew="$(git rev-parse --verify HEAD)" && test -n "$hnew" &&
1451 test "$hnew" = "$h0new" &&
1452 test "$h0new" = "$h1"
1455 test_expect_success SETUP 'staleify two log entries' '
1456 cd main &&
1457 git rev-list --no-walk --objects master@{1} >/dev/null 2>&1 &&
1458 git rev-list --no-walk --objects master@{3} >/dev/null 2>&1 &&
1459 rm -f .git/objects/pack/*.idx &&
1460 test_must_fail git rev-list --no-walk --objects master@{1} >/dev/null 2>&1 &&
1461 test_must_fail git rev-list --no-walk --objects master@{3} >/dev/null 2>&1
1464 test "$test_hash_algo" != "sha1" ||
1465 cat <<\EOT >tgmaster_fix1.log || die
1466 === 2005-04-07 ===
1467 feeb764a 15:16:13 (commit) master@{0}: file 3
1468 c0ed6e70 15:15:13 (commit) master@{1}: file 2
1469 c18fcef2 15:14:13 (commit) master@{2}: file 1
1472 test "$test_hash_algo" != "sha256" ||
1473 cat <<\EOT >tgmaster_fix1.log || die
1474 === 2005-04-07 ===
1475 196f1299 15:16:13 (commit) master@{0}: file 3
1476 7dec28d6 15:15:13 (commit) master@{1}: file 2
1477 ecf5cd74 15:14:13 (commit) master@{2}: file 1
1480 test_expect_success SETUP 'tag --drop master@{0} --stale-fix 1' '
1481 cd main &&
1482 tg tag --drop master@{0} &&
1483 tg tag -g master >actual &&
1484 test_cmp actual ../tgmaster_fix1.log
1487 test "$test_hash_algo" != "sha1" ||
1488 cat <<\EOT >tgmaster_fix2.log || die
1489 === 2005-04-07 ===
1490 c18fcef2 15:14:13 (commit) master@{0}: file 1
1493 test "$test_hash_algo" != "sha256" ||
1494 cat <<\EOT >tgmaster_fix2.log || die
1495 === 2005-04-07 ===
1496 ecf5cd74 15:14:13 (commit) master@{0}: file 1
1499 test_expect_success SETUP 'tag --drop master@{0} --stale-fix 2' '
1500 cd main &&
1501 tg tag --drop master@{0} &&
1502 tg tag -g master >actual &&
1503 test_cmp actual ../tgmaster_fix2.log
1506 test_expect_success SETUP 'tag --drop master@{0} final entry' '
1507 cd main &&
1508 tg tag --drop master@{0} &&
1509 test_must_fail tg tag -g master &&
1510 test_must_fail tg tag --drop master@{0} &&
1511 git rev-parse --verify master -- >/dev/null
1514 test "$test_hash_algo" != "sha1" ||
1515 cat <<\EOT >tglinked_0.log || die
1516 === 2005-04-07 ===
1517 40403e00 15:17:13 (commit) linked@{0}: file 4
1518 0a45d475 15:16:13 (commit) linked@{1}: file 5
1519 e053b7d1 15:15:13 (commit) linked@{2}: file 6
1520 2849f113 15:14:13 (commit) linked@{3}: file 7
1523 test "$test_hash_algo" != "sha256" ||
1524 cat <<\EOT >tglinked_0.log || die
1525 === 2005-04-07 ===
1526 e2552eeb 15:17:13 (commit) linked@{0}: file 4
1527 8575f83f 15:16:13 (commit) linked@{1}: file 5
1528 821fd174 15:15:13 (commit) linked@{2}: file 6
1529 e2473e86 15:14:13 (commit) linked@{3}: file 7
1532 test_expect_success 'SETUP GIT_2_5' 'tag --drop linked@{0} broken' '
1533 cd linked &&
1534 tg tag --drop linked@{0} &&
1535 tg tag -g linked >actual &&
1536 test_cmp actual ../tglinked_0.log
1539 test "$test_hash_algo" != "sha1" ||
1540 cat <<\EOT >tglinked_fix1.log || die
1541 === 2005-04-07 ===
1542 e053b7d1 15:15:13 (commit) linked@{0}: file 6
1543 2849f113 15:14:13 (commit) linked@{1}: file 7
1546 test "$test_hash_algo" != "sha256" ||
1547 cat <<\EOT >tglinked_fix1.log || die
1548 === 2005-04-07 ===
1549 821fd174 15:15:13 (commit) linked@{0}: file 6
1550 e2473e86 15:14:13 (commit) linked@{1}: file 7
1553 test_expect_success 'SETUP GIT_2_5' 'tag --drop linked@{0} --stale-fix 1' '
1554 cd linked &&
1555 tg tag --drop linked@{0} &&
1556 tg tag -g linked >actual &&
1557 test_cmp actual ../tglinked_fix1.log
1560 test_expect_success 'SETUP GIT_2_5' 'tag --drop linked@{0} final entries' '
1561 cd linked &&
1562 tg tag --drop linked@{0} &&
1563 tg tag --drop linked@{0} &&
1564 test_must_fail tg tag -g linked &&
1565 test_must_fail tg tag --drop linked@{0} &&
1566 git rev-parse --verify linked -- >/dev/null
1569 ! { test "$test_hash_algo" = "sha1" && test -z "$git_231_plus"; } ||
1570 cat <<\EOT >tgHEAD_main_pre2 || die
1571 === 2005-04-07 ===
1572 dd1016e3 15:20:13 (commit) HEAD@{0}: file 7
1573 8238c7e7 15:18:13 (commit) HEAD@{1}: file 5
1574 c0ed6e70 15:15:13 (commit) HEAD@{2}: file 2
1575 c18fcef2 15:14:13 (commit) HEAD@{3}: file 1
1578 ! { test "$test_hash_algo" = "sha1" && test -z "$git_231_plus"; } ||
1579 cat <<\EOT >tgHEAD_main_double || die
1580 === 2005-04-07 ===
1581 c18fcef2 15:14:13 (commit) HEAD@{0}: file 1
1584 ! { test "$test_hash_algo" = "sha256" && test -z "$git_231_plus"; } ||
1585 cat <<\EOT >tgHEAD_main_pre2 || die
1586 === 2005-04-07 ===
1587 e784e427 15:20:13 (commit) HEAD@{0}: file 7
1588 71acff48 15:18:13 (commit) HEAD@{1}: file 5
1589 7dec28d6 15:15:13 (commit) HEAD@{2}: file 2
1590 ecf5cd74 15:14:13 (commit) HEAD@{3}: file 1
1593 ! { test "$test_hash_algo" = "sha256" && test -z "$git_231_plus"; } ||
1594 cat <<\EOT >tgHEAD_main_double || die
1595 === 2005-04-07 ===
1596 ecf5cd74 15:14:13 (commit) HEAD@{0}: file 1
1599 ! { test "$test_hash_algo" = "sha1" && test -n "$git_231_plus"; } ||
1600 cat <<\EOT >tgHEAD_main_pre2 || die
1601 === 2005-04-07 ===
1602 dd1016e3 15:20:13 (commit) HEAD@{0}: attaching back to c7
1603 84b1e4e6 15:19:13 (commit) HEAD@{1}: file 6
1604 feeb764a 15:16:13 (commit) HEAD@{2}: file 3
1605 c0ed6e70 15:15:13 (commit) HEAD@{3}: file 2
1606 c18fcef2 15:14:13 (commit) HEAD@{4}: file 1
1609 ! { test "$test_hash_algo" = "sha1" && test -n "$git_231_plus"; } ||
1610 cat <<\EOT >tgHEAD_main_double || die
1611 === 2005-04-07 ===
1612 84b1e4e6 15:19:13 (commit) HEAD@{0}: file 6
1613 feeb764a 15:16:13 (commit) HEAD@{1}: file 3
1614 c0ed6e70 15:15:13 (commit) HEAD@{2}: file 2
1615 c18fcef2 15:14:13 (commit) HEAD@{3}: file 1
1618 ! { test "$test_hash_algo" = "sha256" && test -n "$git_231_plus"; } ||
1619 cat <<\EOT >tgHEAD_main_pre2 || die
1620 === 2005-04-07 ===
1621 e784e427 15:20:13 (commit) HEAD@{0}: attaching back to c7
1622 201a80d1 15:19:13 (commit) HEAD@{1}: file 6
1623 196f1299 15:16:13 (commit) HEAD@{2}: file 3
1624 7dec28d6 15:15:13 (commit) HEAD@{3}: file 2
1625 ecf5cd74 15:14:13 (commit) HEAD@{4}: file 1
1628 ! { test "$test_hash_algo" = "sha256" && test -n "$git_231_plus"; } ||
1629 cat <<\EOT >tgHEAD_main_double || die
1630 === 2005-04-07 ===
1631 201a80d1 15:19:13 (commit) HEAD@{0}: file 6
1632 196f1299 15:16:13 (commit) HEAD@{1}: file 3
1633 7dec28d6 15:15:13 (commit) HEAD@{2}: file 2
1634 ecf5cd74 15:14:13 (commit) HEAD@{3}: file 1
1637 test_expect_success SETUP 'tag --drop detached HEAD@{0} double stale' '
1638 cd main &&
1639 tg tag --drop HEAD@{4} &&
1640 tg tag --drop HEAD@{3} &&
1641 tg tag --drop HEAD@{1} &&
1642 tg tag -g HEAD >actual &&
1643 test_cmp actual ../tgHEAD_main_pre2 &&
1644 tg tag --drop HEAD@{0} &&
1645 tg tag -g HEAD >actual &&
1646 test_cmp actual ../tgHEAD_main_double &&
1647 if test -z "$git_231_plus"; then
1648 test_must_fail git rev-parse --verify --quiet HEAD@{1} -- >/dev/null
1649 else
1650 test_must_fail git rev-parse --verify --quiet HEAD@{4} -- >/dev/null &&
1651 git rev-parse --verify HEAD@{3} -- >/dev/null &&
1652 git rev-parse --verify HEAD@{2} -- >/dev/null &&
1653 git rev-parse --verify HEAD@{1} -- >/dev/null
1654 fi &&
1655 git rev-parse --verify HEAD@{0} -- >/dev/null &&
1656 git rev-parse --verify HEAD -- >/dev/null
1659 ! { test "$test_hash_algo" = "sha1" && test -z "$git_231_plus"; } ||
1660 cat <<\EOT >tgHEAD_linked_only || die
1661 === 2005-04-07 ===
1662 04eea982 15:20:13 (commit) HEAD@{0}: file 1
1663 4d776c64 15:19:13 (commit) HEAD@{1}: file 2
1664 0a45d475 15:16:13 (commit) HEAD@{2}: file 5
1667 ! { test "$test_hash_algo" = "sha256" && test -z "$git_231_plus"; } ||
1668 cat <<\EOT >tgHEAD_linked_only || die
1669 === 2005-04-07 ===
1670 6fda165d 15:20:13 (commit) HEAD@{0}: file 1
1671 1a6140d4 15:19:13 (commit) HEAD@{1}: file 2
1672 8575f83f 15:16:13 (commit) HEAD@{2}: file 5
1675 ! { test "$test_hash_algo" = "sha1" && test -n "$git_231_plus"; } ||
1676 cat <<\EOT >tgHEAD_linked_only || die
1677 === 2005-04-07 ===
1678 04eea982 15:20:13 (commit) HEAD@{0}: attaching back to linked c1
1679 04eea982 15:20:13 (commit) HEAD@{1}: file 1
1680 40403e00 15:17:13 (commit) HEAD@{2}: file 4
1681 2849f113 15:14:13 (commit) HEAD@{3}: file 7
1684 ! { test "$test_hash_algo" = "sha256" && test -n "$git_231_plus"; } ||
1685 cat <<\EOT >tgHEAD_linked_only || die
1686 === 2005-04-07 ===
1687 6fda165d 15:20:13 (commit) HEAD@{0}: attaching back to linked c1
1688 6fda165d 15:20:13 (commit) HEAD@{1}: file 1
1689 e2552eeb 15:17:13 (commit) HEAD@{2}: file 4
1690 e2473e86 15:14:13 (commit) HEAD@{3}: file 7
1693 test_expect_success 'SETUP GIT_2_5' 'tag --drop detached HEAD@{0} [linked] all stale' '
1694 cd linked &&
1695 tg tag --drop HEAD@{6} &&
1696 tg tag --drop HEAD@{5} &&
1697 tg tag --drop HEAD@{3} &&
1698 tg tag --drop HEAD@{2} &&
1699 tg tag -g HEAD >actual &&
1700 test_cmp actual ../tgHEAD_linked_only &&
1701 tg tag --drop HEAD@{0} &&
1702 if test -z "$git_231_plus"; then
1703 test_must_fail git rev-parse --verify --quiet HEAD@{0} -- >/dev/null
1704 else
1705 test_must_fail git rev-parse --verify --quiet HEAD@{3} -- >/dev/null
1706 git rev-parse --verify HEAD@{2} -- >/dev/null &&
1707 git rev-parse --verify HEAD@{1} -- >/dev/null &&
1708 git rev-parse --verify HEAD@{0} -- >/dev/null
1709 fi &&
1710 git rev-parse --verify HEAD -- >/dev/null
1713 ! { test "$test_hash_algo" = "sha1" && test -z "$git_231_plus"; } ||
1714 cat <<\EOT >tgHEAD_main_new || die
1715 === 2005-04-07 ===
1716 c18fcef2 15:14:13 (commit) HEAD@{0}: allons master
1717 b63866e5 15:13:13 (commit) HEAD@{1}: to empty main
1718 c18fcef2 15:14:13 (commit) HEAD@{2}: file 1
1721 ! { test "$test_hash_algo" = "sha256" && test -z "$git_231_plus"; } ||
1722 cat <<\EOT >tgHEAD_main_new || die
1723 === 2005-04-07 ===
1724 ecf5cd74 15:14:13 (commit) HEAD@{0}: allons master
1725 079309f2 15:13:13 (commit) HEAD@{1}: to empty main
1726 ecf5cd74 15:14:13 (commit) HEAD@{2}: file 1
1729 ! { test "$test_hash_algo" = "sha1" && test -n "$git_231_plus"; } ||
1730 cat <<\EOT >tgHEAD_main_new || die
1731 === 2005-04-07 ===
1732 b63866e5 15:14:13 (commit) HEAD@{0}: allons master
1733 b63866e5 15:13:13 (commit) HEAD@{1}: to empty main
1734 84b1e4e6 15:19:13 (commit) HEAD@{2}: file 6
1735 feeb764a 15:16:13 (commit) HEAD@{3}: file 3
1736 c0ed6e70 15:15:13 (commit) HEAD@{4}: file 2
1737 c18fcef2 15:14:13 (commit) HEAD@{5}: file 1
1740 ! { test "$test_hash_algo" = "sha256" && test -n "$git_231_plus"; } ||
1741 cat <<\EOT >tgHEAD_main_new || die
1742 === 2005-04-07 ===
1743 079309f2 15:14:13 (commit) HEAD@{0}: allons master
1744 079309f2 15:13:13 (commit) HEAD@{1}: to empty main
1745 201a80d1 15:19:13 (commit) HEAD@{2}: file 6
1746 196f1299 15:16:13 (commit) HEAD@{3}: file 3
1747 7dec28d6 15:15:13 (commit) HEAD@{4}: file 2
1748 ecf5cd74 15:14:13 (commit) HEAD@{5}: file 1
1751 test_expect_success SETUP 'rebuild HEAD log' '
1752 cd main &&
1753 test_tick &&
1754 git update-ref -m "to empty main" HEAD "$mtcommit" HEAD &&
1755 test_tick &&
1756 git update-ref -m "allons master" HEAD master HEAD &&
1757 tg tag -g HEAD >actual &&
1758 test_cmp actual ../tgHEAD_main_new
1761 ! { test "$test_hash_algo" = "sha1" && test -z "$git_231_plus"; } ||
1762 cat <<\EOT >tgHEAD_linked_new || die
1763 === 2005-04-07 ===
1764 04eea982 15:15:13 (commit) HEAD@{0}: HEAD back
1765 2849f113 15:14:13 (commit) HEAD@{1}: allons linked
1766 b63866e5 15:13:13 (commit) HEAD@{2}: to empty linked
1769 ! { test "$test_hash_algo" = "sha256" && test -z "$git_231_plus"; } ||
1770 cat <<\EOT >tgHEAD_linked_new || die
1771 === 2005-04-07 ===
1772 6fda165d 15:15:13 (commit) HEAD@{0}: HEAD back
1773 e2473e86 15:14:13 (commit) HEAD@{1}: allons linked
1774 079309f2 15:13:13 (commit) HEAD@{2}: to empty linked
1777 ! { test "$test_hash_algo" = "sha1" && test -n "$git_231_plus"; } ||
1778 cat <<\EOT >tgHEAD_linked_new || die
1779 === 2005-04-07 ===
1780 2849f113 15:15:13 (commit) HEAD@{0}: HEAD back
1781 b63866e5 15:14:13 (commit) HEAD@{1}: allons linked
1782 b63866e5 15:13:13 (commit) HEAD@{2}: to empty linked
1783 04eea982 15:20:13 (commit) HEAD@{3}: file 1
1784 40403e00 15:17:13 (commit) HEAD@{4}: file 4
1785 2849f113 15:14:13 (commit) HEAD@{5}: file 7
1788 ! { test "$test_hash_algo" = "sha256" && test -n "$git_231_plus"; } ||
1789 cat <<\EOT >tgHEAD_linked_new || die
1790 === 2005-04-07 ===
1791 e2473e86 15:15:13 (commit) HEAD@{0}: HEAD back
1792 079309f2 15:14:13 (commit) HEAD@{1}: allons linked
1793 079309f2 15:13:13 (commit) HEAD@{2}: to empty linked
1794 6fda165d 15:20:13 (commit) HEAD@{3}: file 1
1795 e2552eeb 15:17:13 (commit) HEAD@{4}: file 4
1796 e2473e86 15:14:13 (commit) HEAD@{5}: file 7
1799 test_expect_success 'SETUP GIT_2_5' 'rebuild HEAD log [linked]' '
1800 cd linked &&
1801 cur="$(git rev-parse --verify HEAD)" && test -n "$cur" &&
1802 test_tick &&
1803 git update-ref -m "to empty linked" HEAD "$mtcommit" HEAD &&
1804 test_tick &&
1805 git update-ref -m "allons linked" HEAD linked HEAD &&
1806 test_tick &&
1807 git update-ref -m "HEAD back" HEAD "$cur" &&
1808 tg tag -g HEAD >actual &&
1809 test_cmp actual ../tgHEAD_linked_new
1812 ! { test "$test_hash_algo" = "sha1" && test -z "$git_231_plus"; } ||
1813 cat <<\EOT >tgHEAD_main_cleared || die
1814 commit c18fcef2dd73f7969b45b108d061309b670c886c
1815 Reflog: HEAD@{0} (Fra mewor k (Committer) <framework@example.org>)
1816 Reflog message: allons master
1817 Author: Te s t (Author) <test@example.net>
1818 AuthorDate: Thu Apr 7 15:14:13 2005 -0700
1819 Commit: Fra mewor k (Committer) <framework@example.org>
1820 CommitDate: Thu Apr 7 15:14:13 2005 -0700
1822 file 1
1825 ! { test "$test_hash_algo" = "sha256" && test -z "$git_231_plus"; } ||
1826 cat <<\EOT >tgHEAD_main_cleared || die
1827 commit ecf5cd744123c8f322d61b4a97d18d75f1c25440ca838a9654decff6b8697226
1828 Reflog: HEAD@{0} (Fra mewor k (Committer) <framework@example.org>)
1829 Reflog message: allons master
1830 Author: Te s t (Author) <test@example.net>
1831 AuthorDate: Thu Apr 7 15:14:13 2005 -0700
1832 Commit: Fra mewor k (Committer) <framework@example.org>
1833 CommitDate: Thu Apr 7 15:14:13 2005 -0700
1835 file 1
1838 ! { test "$test_hash_algo" = "sha1" && test -n "$git_231_plus"; } ||
1839 cat <<\EOT >tgHEAD_main_cleared || die
1840 commit b63866e540ea13ef92d9eaad23c571912019da41
1841 Reflog: HEAD@{0} (Fra mewor k (Committer) <framework@example.org>)
1842 Reflog message: allons master
1843 Author: Te s t (Author) <test@example.net>
1844 AuthorDate: Thu Apr 7 15:13:13 2005 -0700
1845 Commit: Fra mewor k (Committer) <framework@example.org>
1846 CommitDate: Thu Apr 7 15:13:13 2005 -0700
1848 empty
1851 ! { test "$test_hash_algo" = "sha256" && test -n "$git_231_plus"; } ||
1852 cat <<\EOT >tgHEAD_main_cleared || die
1853 commit 079309f2fa99f1dc84e7d2b40b25766e2e6ff4da86bc8f2be31487085cc9359a
1854 Reflog: HEAD@{0} (Fra mewor k (Committer) <framework@example.org>)
1855 Reflog message: allons master
1856 Author: Te s t (Author) <test@example.net>
1857 AuthorDate: Thu Apr 7 15:13:13 2005 -0700
1858 Commit: Fra mewor k (Committer) <framework@example.org>
1859 CommitDate: Thu Apr 7 15:13:13 2005 -0700
1861 empty
1864 test_expect_success SETUP 'tag --clear HEAD' '
1865 cd main &&
1866 tg tag --clear HEAD &&
1867 head -n 2 <../tgHEAD_main_new >expected &&
1868 tg tag -g HEAD >actual &&
1869 test_cmp actual expected &&
1870 tg tag --clear HEAD &&
1871 tg tag -g HEAD >actual &&
1872 test_cmp actual expected &&
1873 git log -g --pretty=fuller HEAD >actual &&
1874 test_cmp actual ../tgHEAD_main_cleared
1877 ! { test "$test_hash_algo" = "sha1" && test -z "$git_231_plus"; } ||
1878 cat <<\EOT >tgHEAD_linked_cleared || die
1879 commit 04eea982f4572b35c7cbb6597f5d777661f15e60
1880 Reflog: HEAD@{0} (Fra mewor k (Committer) <framework@example.org>)
1881 Reflog message: HEAD back
1882 Author: Te s t (Author) <test@example.net>
1883 AuthorDate: Thu Apr 7 15:20:13 2005 -0700
1884 Commit: Fra mewor k (Committer) <framework@example.org>
1885 CommitDate: Thu Apr 7 15:20:13 2005 -0700
1887 file 1
1890 ! { test "$test_hash_algo" = "sha256" && test -z "$git_231_plus"; } ||
1891 cat <<\EOT >tgHEAD_linked_cleared || die
1892 commit 6fda165d8aaa203d2bf9a67dcd750ac6e273489ea89e174866c1170d81cf2f73
1893 Reflog: HEAD@{0} (Fra mewor k (Committer) <framework@example.org>)
1894 Reflog message: HEAD back
1895 Author: Te s t (Author) <test@example.net>
1896 AuthorDate: Thu Apr 7 15:20:13 2005 -0700
1897 Commit: Fra mewor k (Committer) <framework@example.org>
1898 CommitDate: Thu Apr 7 15:20:13 2005 -0700
1900 file 1
1903 ! { test "$test_hash_algo" = "sha1" && test -n "$git_231_plus"; } ||
1904 cat <<\EOT >tgHEAD_linked_cleared || die
1905 commit 2849f113c66cbf3c9521e90be3bc7e39fce8db16
1906 Reflog: HEAD@{0} (Fra mewor k (Committer) <framework@example.org>)
1907 Reflog message: HEAD back
1908 Author: Te s t (Author) <test@example.net>
1909 AuthorDate: Thu Apr 7 15:14:13 2005 -0700
1910 Commit: Fra mewor k (Committer) <framework@example.org>
1911 CommitDate: Thu Apr 7 15:14:13 2005 -0700
1913 file 7
1916 ! { test "$test_hash_algo" = "sha256" && test -n "$git_231_plus"; } ||
1917 cat <<\EOT >tgHEAD_linked_cleared || die
1918 commit e2473e861fd48f0ece81fdbd760dde169c6e00c57b426f85853b59203760214b
1919 Reflog: HEAD@{0} (Fra mewor k (Committer) <framework@example.org>)
1920 Reflog message: HEAD back
1921 Author: Te s t (Author) <test@example.net>
1922 AuthorDate: Thu Apr 7 15:14:13 2005 -0700
1923 Commit: Fra mewor k (Committer) <framework@example.org>
1924 CommitDate: Thu Apr 7 15:14:13 2005 -0700
1926 file 7
1929 test_expect_success 'SETUP GIT_2_5' 'tag --clear HEAD [linked]' '
1930 cd linked &&
1931 tg tag --clear HEAD &&
1932 head -n 2 <../tgHEAD_linked_new >expected &&
1933 tg tag -g HEAD >actual &&
1934 test_cmp actual expected &&
1935 tg tag --clear HEAD &&
1936 tg tag -g HEAD >actual &&
1937 test_cmp actual expected &&
1938 git log -g --pretty=fuller HEAD >actual &&
1939 test_cmp actual ../tgHEAD_linked_cleared
1942 test_expect_success 'SETUP GIT_2_5' 'tag --clear HEAD w/o log fails [linked]' '
1943 cd linked &&
1944 git rev-parse --verify HEAD@{0} >/dev/null -- &&
1945 tg tag --clear HEAD &&
1946 tg tag --drop HEAD@{0} &&
1947 test -e ../main/.git/worktrees/linked/logs/HEAD &&
1948 ! test -s ../main/.git/worktrees/linked/logs/HEAD &&
1949 test_must_fail tg tag --clear HEAD
1952 test_expect_success '!GIT_2_31 LASTOK SETUP GIT_2_5' \
1953 'HEAD@{0} fails after tag --clear and --drop @{0} [linked]' '
1954 cd linked &&
1955 test_must_fail git rev-parse --verify HEAD@{0} --
1958 test_expect_success SETUP 'tag --clear HEAD w/o log fails' '
1959 cd main &&
1960 git rev-parse --verify HEAD@{0} >/dev/null -- &&
1961 tg tag --clear HEAD &&
1962 tg tag --drop HEAD@{0} &&
1963 test -e .git/logs/HEAD &&
1964 ! test -s .git/logs/HEAD &&
1965 test_must_fail tg tag --clear HEAD
1968 test_expect_success '!GIT_2_31 LASTOK SETUP' \
1969 'HEAD@{0} fails after tag --clear and --drop @{0}' '
1970 cd main &&
1971 test_must_fail git rev-parse --verify HEAD@{0} --
1974 test_done