Author: A U Thor <author@example.com>
Date: $prior_commit_date
- commit on tag branch
+ commit on annotated tagged branch
commit $new_commit_hash
Author: A U Thor <author@example.com>
Date: $new_commit_date
- commit on tag branch 2
+ commit on annotated tagged branch 2
-----------------------------------------------------------------------
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/a b/a
-index 146f275..affecee 100644
+index 146f275..7d07572 100644
--- a/a
+++ b/a
@@ -1 +1 @@
-setup
-+commit on tag branch 2
++commit on annotated tagged branch 2
hooks/post-receive
2.0
A U Thor (2):
- commit on tag branch
- commit on tag branch 2
+ commit on annotated tagged branch
+ commit on annotated tagged branch 2
-----------------------------------------------------------------------
Author: A U Thor <author@example.com>
Date: $new_commit_date
- update lightweight tag
+ force update lightweight tag
-----------------------------------------------------------------------
was $old_commit_hash
-----------------------------------------------------------------------
-$old_commit_hash update lightweight tag
+$old_commit_hash force update lightweight tag
-----------------------------------------------------------------------
--- /dev/null
+From: author@payflex.com
+To: commits@list.com
+Subject: [cbas] 2.0 annotated tag updated. 2.0
+X-Git-Refname: refs/tags/2.0
+X-Git-Reftype: annotated tag
+X-Git-Oldrev: $old_tag_hash
+X-Git-Newrev: $new_tag_hash
+
+The annotated tag, 2.0 has been updated
+ to $new_tag_hash (tag)
+ from $old_tag_hash (which is now obsolete)
+ tagging $new_commit_hash (commit)
+ replaces 1.0
+ tagged by C O Mitter
+ on $tag_date
+
+- Log -----------------------------------------------------------------
+2.0
+
+A U Thor (3):
+ commit on annotated tagged branch
+ commit on annotated tagged branch 2
+ force update annotated tag
+
+-----------------------------------------------------------------------
+
+
+hooks/post-receive
+--
+cbas
--- /dev/null
+From: author@payflex.com
+To: commits@list.com
+Subject: [cbas] 2.0 annotated tag deleted. $new_commit_describe
+X-Git-Refname: refs/tags/2.0
+X-Git-Reftype: annotated tag
+X-Git-Oldrev: $old_tag_hash
+X-Git-Newrev: 0000000000000000000000000000000000000000
+
+The annotated tag, 2.0 has been deleted
+ was $old_tag_hash
+
+-----------------------------------------------------------------------
+tag 2.0
+Tagger: C O Mitter <committer@example.com>
+Date: $old_tag_date
+
+2.0
+$new_commit_hash force update annotated tag
+-----------------------------------------------------------------------
+
+
+hooks/post-receive
+--
+cbas
install_post_receive_hook 'post-receive-email'
-test_expect_success 'create tag' '
+test_expect_success 'create annotated tag' '
git tag -a -m 1.0 1.0 &&
git push --tags &&
new_commit_hash=$(git rev-parse HEAD) &&
test_cmp 1.txt server/.git/refs.tags.1.0.out
'
-test_expect_success 'commit on tag branch' '
+test_expect_success 'commit on annotated tagged branch' '
old_commit_hash=$(git rev-parse HEAD) &&
echo "$test_name" >a &&
git commit -a -m "$test_name" &&
test_cmp 2.txt server/.git/refs.heads.master.out
'
-test_expect_success 'retag branch' '
+test_expect_success 're-annotated tag branch' '
git tag -a -m 2.0 2.0 &&
git push --tags &&
new_commit_hash=$(git rev-parse HEAD) &&
test_cmp 3.txt server/.git/refs.tags.2.0.out
'
+test_expect_success 'force update annotated tag' '
+ old_tag_hash=$(git rev-parse 2.0) &&
+
+ echo "$test_name" >a &&
+ git commit -a -m "$test_name" &&
+ new_commit_hash=$(git rev-parse HEAD) &&
+ new_commit_date=$(git log -n 1 --pretty=format:%cd HEAD) &&
+
+ git tag -f -a -m 2.0 2.0 &&
+ git push --tags &&
+ new_tag_hash=$(git rev-parse 2.0) &&
+ eval $(git for-each-ref --shell "--format=tag_date=%(taggerdate)" refs/tags/2.0) &&
+
+ interpolate ../t2201-7.txt 7.txt old_tag_hash new_commit_hash new_tag_hash tag_date &&
+ test_cmp 7.txt server/.git/refs.tags.2.0.out
+'
+
+test_expect_success 'delete annotated tag' '
+ old_tag_hash=$(git rev-parse 2.0) &&
+ eval $(git for-each-ref --shell "--format=old_tag_date=%(taggerdate)" refs/tags/2.0) &&
+
+ git tag -d 2.0 &&
+ git push origin :refs/tags/2.0 &&
+
+ new_commit_describe=$(git describe HEAD) &&
+ new_commit_hash=$(git rev-parse HEAD) &&
+
+ interpolate ../t2201-8.txt 8.txt old_tag_hash old_tag_date new_commit_describe new_commit_hash &&
+ test_cmp 8.txt server/.git/refs.tags.2.0.out
+'
+
test_expect_success 'create lightweight tag' '
echo "$test_name" >a &&
git commit -a -m "$test_name" &&
test_cmp 4.txt server/.git/refs.tags.2.1.out
'
-test_expect_success 'update lightweight tag' '
+test_expect_success 'force update lightweight tag' '
old_commit_hash=$(git rev-parse HEAD) &&
echo "$test_name" >a &&
git commit -a -m "$test_name" &&