record the git repo

This commit is contained in:
2024-09-13 18:44:13 -05:00
committed by Celtic Minstrel
parent c371aac84b
commit 640492a428
3 changed files with 5 additions and 1 deletions

View File

@@ -7,5 +7,6 @@ REVID=`git rev-parse HEAD`;
export FULLTAG=`git tag --sort=v:refname | tail -n1`;
TAGREV=`git rev-parse $FULLTAG`;
STATUS=`git diff-index --quiet HEAD -- && echo "clean" || echo "modified"`;
REPO=`git remote get-url origin`;
echo -e "\n#define GIT_REVISION \"${REVID:0:7}\"\n#define GIT_TAG \"$FULLTAG\"\n#define GIT_TAG_REVISION \"${TAGREV:0:7}\"\n#define GIT_STATUS \"${STATUS}\"\n" > "$1/tools/gitrev.hpp"
echo -e "\n#define GIT_REVISION \"${REVID:0:7}\"\n#define GIT_TAG \"$FULLTAG\"\n#define GIT_TAG_REVISION \"${TAGREV:0:7}\"\n#define GIT_STATUS \"${STATUS}\"\n#define GIT_REPO \"${REPO}\"\n" > "$1/tools/gitrev.hpp"