summaryrefslogtreecommitdiff
path: root/git-tag-script
blob: 281d192814ec200199379f44fef10d2b04f762c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/sh
# Copyright (c) 2005 Linus Torvalds

: ${GIT_DIR=.git}

object=${2:-$(cat "$GIT_DIR"/HEAD)}
type=$(git-cat-file -t $object) || exit 1
( echo -e "object $object\ntype $type\ntag $1\n"; cat ) > .tmp-tag
rm -f .tmp-tag.asc
gpg -bsa .tmp-tag && cat .tmp-tag.asc >> .tmp-tag
git-mktag < .tmp-tag
#rm .tmp-tag .tmp-tag.sig