2010-05-18 00:36:48 +02:00
|
|
|
#!/bin/sh
|
2010-05-18 12:17:51 +02:00
|
|
|
GIT_SHA1=$(git show-ref --head --hash=8 2> /dev/null | head -n1)
|
2010-05-18 10:08:51 +02:00
|
|
|
GIT_DIRTY=$(git diff 2> /dev/null | wc -l)
|
2010-05-18 00:36:48 +02:00
|
|
|
test -f release.h || touch release.h
|
|
|
|
(cat release.h | grep SHA1 | grep $GIT_SHA1) && \
|
|
|
|
(cat release.h | grep DIRTY | grep $GIT_DIRTY) && exit 0 # Already uptodate
|
|
|
|
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
|
2010-05-18 00:36:48 +02:00
|
|
|
touch redis.c # force recompile of redis.c
|