aboutsummaryrefslogtreecommitdiffstats
path: root/git-version.sh
blob: 204ffec43dc5b5530237ec06596a3da5c8c1d6b0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/sh

if head=`git rev-parse --verify HEAD 2>/dev/null`; then
	git update-index --refresh --unmerged > /dev/null
	printf "#define ANTISPAM_GIT_VERSION \"git %.8s" "$head"
	if git diff-index --name-only HEAD | read dummy ; then
		printf ", dirty"
	fi
	echo '"'
else
	echo '#define ANTISPAM_GIT_VERSION "unknown"'
fi