From 3c2e3f35a0ca0c926dbd30314f701ce66e0d257e Mon Sep 17 00:00:00 2001 From: rexy712 Date: Sun, 16 Dec 2018 07:18:31 -0800 Subject: [PATCH] Version now includes dirty status on exact version tags too --- include/config.h | 6 +++++- scripts/git_commit_hash.py | 2 ++ scripts/git_commit_hash.sh | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/include/config.h b/include/config.h index 8c55ea0..6abf809 100644 --- a/include/config.h +++ b/include/config.h @@ -22,7 +22,11 @@ #include "version.h" #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 #define REXBACKLIGHT_VERSION GIT_BRANCH_NAME "-" GIT_COMMIT_HASH #endif diff --git a/scripts/git_commit_hash.py b/scripts/git_commit_hash.py index 54d1c13..c18fb12 100755 --- a/scripts/git_commit_hash.py +++ b/scripts/git_commit_hash.py @@ -6,3 +6,5 @@ output = subprocess.run(['git', 'describe', "--always", "--dirty", "--abbrev", " if output: print("#define GIT_COMMIT_HASH " + '"' + output + '"') + if output.find("dirty") != -1: + print("#define GIT_DIRTY") diff --git a/scripts/git_commit_hash.sh b/scripts/git_commit_hash.sh index 01e315d..73ae398 100755 --- a/scripts/git_commit_hash.sh +++ b/scripts/git_commit_hash.sh @@ -4,4 +4,7 @@ output="$(git describe --always --dirty --abbrev --match="NeVeRmAtCh")" if test -n output;then echo "#define GIT_COMMIT_HASH \"$output\"" + if grep -q "dirty" <<< "$output";then + echo "#define GIT_DIRTY" + fi fi