13 test $# -eq 2 || die
"Usage: $0 <commit> <tagname>"
18 git rev-parse
--verify -q "$commit" >/dev
/null || die
"Cannot parse $commit."
20 test x$
(git cat-file
-t $commit) == "xcommit" || die
"$commit is no commit."
24 git cat-file commit
"$commit" |
{
26 test $drop == "tree" || die
"No tree."
28 test $drop = "parent" || die
"No parent."
30 test $drop == "author" || die
"No author."
32 test $drop == "committer" || die
"No committer."
33 test "$author" == "$committer" || warn
"author $author != committer $committer, taking author."
34 ptree
=$
(git cat-file
-p $parent|fgrep tree|
head -1|cut
-d' ' -f2)
35 test $ptree == $tree || die
"commit $commit introduces a diff."
43 hash=$
(git hash-object
-t tag
-w "$tagfile")
44 git tag
"$tagname" $hash