2010-05-18 00:36:48 +02:00
|
|
|
#!/bin/sh
|
2010-05-20 12:33:33 +02:00
|
|
|
GIT_SHA1=`(git show-ref --head --hash=8 2> /dev/null || echo 00000000) | head -n1`
|
2013-02-24 17:43:56 +01:00
|
|
|
GIT_DIRTY=`git diff --no-ext-diff 2> /dev/null | wc -l`
|
2012-11-29 14:20:08 +01:00
|
|
|
BUILD_ID=`uname -n`"-"`date +%s`
|
2010-05-18 00:36:48 +02:00
|
|
|
test -f release.h || touch release.h
|
|
|
|
(cat release.h | grep SHA1 | grep $GIT_SHA1) && \
|
2013-01-17 01:00:20 +08:00
|
|
|
(cat release.h | grep DIRTY | grep $GIT_DIRTY) && exit 0 # Already up-to-date
|
2010-05-18 00:36:48 +02:00
|
|
|
echo "#define REDIS_GIT_SHA1 \"$GIT_SHA1\"" > release.h
|
2010-05-18 12:17:51 +02:00
|
|
|
echo "#define REDIS_GIT_DIRTY \"$GIT_DIRTY\"" >> release.h
|
2012-11-29 14:20:08 +01:00
|
|
|
echo "#define REDIS_BUILD_ID \"$BUILD_ID\"" >> release.h
|
2010-06-13 23:51:43 +02:00
|
|
|
touch release.c # Force recompile of release.c
|