summaryrefslogtreecommitdiffstats
path: root/bin/git-debian-tag
blob: 5afbc8c32bfef258a74fb719352658e290ceca62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

set -e

if [ -n "$(git config --get user.signingKey)" ]
then
	GIT_OPTIONS="-s"
else
	GIT_OPTIONS="-a"
fi

MODE="$(basename ${0} | sed -e 's|^git-||' -e 's|-tag$||')"

VERSION="${1}"
HASH="${2}"

TAG="$(echo ${VERSION} | sed -e "s|^${MODE}/||" -e 's|:|%|g' -e 's|~|_|g')"

git tag ${GIT_OPTIONS} -f -m "Tagging ${MODE} version ${VERSION}." ${MODE}/${TAG} ${HASH}