diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-06-02 10:43:01 +0200 |
---|---|---|
committer | Johannes Berg <johannes@sipsolutions.net> | 2008-06-02 10:43:01 +0200 |
commit | 2e009bcb22f479a40f8112f8c8ea8d6a5f17b732 (patch) | |
tree | 88951328c1c4df675e19f8f094ee05a7ed172ccc /git-version.sh | |
parent | d75a3cf64fc0e7f61533f96371fd99af7d987849 (diff) | |
download | dovecot-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-x | git-version.sh | 12 |
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 |