summaryrefslogtreecommitdiffstats
path: root/bin/git-debian-add
blob: 06e25b97d2b526f679eebcb2daf8b3fbdc00043c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh

set -e

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

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

if [ -n "${1}" ]
then
	VERSION="${1}"
else
	VERSION="$(dpkg-parsechangelog | awk '/^Version: / { print $2 }')"
fi

HASH="${2}"

chmod 0755 debian/rules

git add -A -f
git commit -a -s -m "Adding ${MODE} version ${VERSION}." ${GIT_OPTIONS}
git-${MODE}-tag ${VERSION} ${HASH}