aboutsummaryrefslogtreecommitdiffstats
path: root/git-version.sh
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-06-02 10:43:01 +0200
committerJohannes Berg <johannes@sipsolutions.net>2008-06-02 10:43:01 +0200
commit2e009bcb22f479a40f8112f8c8ea8d6a5f17b732 (patch)
tree88951328c1c4df675e19f8f094ee05a7ed172ccc /git-version.sh
parentd75a3cf64fc0e7f61533f96371fd99af7d987849 (diff)
downloaddovecot-antispam-2e009bcb22f479a40f8112f8c8ea8d6a5f17b732.tar.gz
dovecot-antispam-2e009bcb22f479a40f8112f8c8ea8d6a5f17b732.tar.xz
dovecot-antispam-2e009bcb22f479a40f8112f8c8ea8d6a5f17b732.zip
add git version to plugin
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