Back to home page

Redis cross reference

 
 

    


0001 #!/bin/sh
0002 GIT_SHA1=`(git show-ref --head --hash=8 2> /dev/null || echo 00000000) | head -n1`
0003 GIT_DIRTY=`git diff --no-ext-diff 2> /dev/null | wc -l`
0004 test -f release.h || touch release.h
0005 (cat release.h | grep SHA1 | grep $GIT_SHA1) && \
0006 (cat release.h | grep DIRTY | grep $GIT_DIRTY) && exit 0 # Already up-to-date
0007 echo "#define REDIS_GIT_SHA1 \"$GIT_SHA1\"" > release.h
0008 echo "#define REDIS_GIT_DIRTY \"$GIT_DIRTY\"" >> release.h
0009 touch release.c # Force recompile of release.c