aboutsummaryrefslogtreecommitdiff
path: root/mesalib/bin/extract_git_sha1
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-04-06 21:03:59 +0000
committermarha <marha@users.sourceforge.net>2011-04-06 21:03:59 +0000
commite2b908c356746281aba48128da7dc15a28f5a773 (patch)
tree5f0a12dfa33c059d8fe09d9a5a792792f44189a6 /mesalib/bin/extract_git_sha1
parent1fc1b7f67928082b9e922463be25c232d9bcba6a (diff)
parent704e01fc69ebf6302aa1876906805147248abdaa (diff)
downloadvcxsrv-e2b908c356746281aba48128da7dc15a28f5a773.tar.gz
vcxsrv-e2b908c356746281aba48128da7dc15a28f5a773.tar.bz2
vcxsrv-e2b908c356746281aba48128da7dc15a28f5a773.zip
svn merge ^/branches/released .
Diffstat (limited to 'mesalib/bin/extract_git_sha1')
-rw-r--r--mesalib/bin/extract_git_sha110
1 files changed, 10 insertions, 0 deletions
diff --git a/mesalib/bin/extract_git_sha1 b/mesalib/bin/extract_git_sha1
new file mode 100644
index 000000000..cf3006f8f
--- /dev/null
+++ b/mesalib/bin/extract_git_sha1
@@ -0,0 +1,10 @@
+#!/bin/sh
+touch src/mesa/main/git_sha1.h
+if which git > /dev/null; then
+ # Extract the 7-digit "short" SHA1 for the current HEAD, convert
+ # it to a string, and wrap it in a #define. This is used in
+ # src/mesa/main/version.c to put the GIT SHA1 in the GL_VERSION string.
+ git log -n 1 --oneline |\
+ sed 's/^\([^ ]*\) .*/#define MESA_GIT_SHA1 "git-\1"/' \
+ > src/mesa/main/git_sha1.h
+fi