Version now includes dirty status on exact version tags too

This commit is contained in:
rexy712 2018-12-16 07:18:31 -08:00
parent 00062612f5
commit 3c2e3f35a0
3 changed files with 10 additions and 1 deletions

View File

@ -22,7 +22,11 @@
#include "version.h" #include "version.h"
#ifdef GIT_TAG_NAME #ifdef GIT_TAG_NAME
#define REXBACKLIGHT_VERSION GIT_TAG_NAME #ifdef GIT_DIRTY
#define REXBACKLIGHT_VERSION GIT_TAG_NAME "-dirty"
#else
#define REXBACKLIGHT_VERSION GIT_TAG_NAME
#endif
#else #else
#define REXBACKLIGHT_VERSION GIT_BRANCH_NAME "-" GIT_COMMIT_HASH #define REXBACKLIGHT_VERSION GIT_BRANCH_NAME "-" GIT_COMMIT_HASH
#endif #endif

View File

@ -6,3 +6,5 @@ output = subprocess.run(['git', 'describe', "--always", "--dirty", "--abbrev", "
if output: if output:
print("#define GIT_COMMIT_HASH " + '"' + output + '"') print("#define GIT_COMMIT_HASH " + '"' + output + '"')
if output.find("dirty") != -1:
print("#define GIT_DIRTY")

View File

@ -4,4 +4,7 @@ output="$(git describe --always --dirty --abbrev --match="NeVeRmAtCh")"
if test -n output;then if test -n output;then
echo "#define GIT_COMMIT_HASH \"$output\"" echo "#define GIT_COMMIT_HASH \"$output\""
if grep -q "dirty" <<< "$output";then
echo "#define GIT_DIRTY"
fi
fi fi