aboutsummaryrefslogtreecommitdiffstats
path: root/git-version.sh
diff options
context:
space:
mode:
Diffstat (limited to 'git-version.sh')
-rwxr-xr-xgit-version.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/git-version.sh b/git-version.sh
new file mode 100755
index 0000000..204ffec
--- /dev/null
+++ b/git-version.sh
@@ -0,0 +1,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