aboutsummaryrefslogtreecommitdiff
path: root/build.bat
diff options
context:
space:
mode:
authorHasan Yasin Ozturk <hasan@mond.red>2023-07-31 17:18:06 +0300
committerHasan Yasin Ozturk <hasan@mond.red>2023-07-31 17:29:56 +0300
commit3d16880d95e1649cc375cfe41ba10a26a6ebadb8 (patch)
tree3e610aa71a9166c8d1f7fe9217cf69827e4e599b /build.bat
parentbe6f355665a0e9d469f7c405e918b0bb64d4f793 (diff)
Set version date to commit date instead of build date
Fixes #2688 This commit updates `build_odin.sh` and `build.bat` so that date of the commit is used for the version tag, instead of the build time.
Diffstat (limited to 'build.bat')
-rw-r--r--build.bat5
1 files changed, 4 insertions, 1 deletions
diff --git a/build.bat b/build.bat
index b7537fba6..cee679773 100644
--- a/build.bat
+++ b/build.bat
@@ -51,7 +51,10 @@ set compiler_flags= -nologo -Oi -TP -fp:precise -Gm- -MP -FC -EHsc- -GR- -GF
set compiler_defines= -DODIN_VERSION_RAW=\"%odin_version_raw%\"
if not exist .git\ goto skip_git_hash
-for /f %%i in ('git rev-parse --short HEAD') do set GIT_SHA=%%i
+for /f "tokens=1,2" %%i IN ('git show "--pretty=%%cd %%h" "--date=format:%%Y-%%m" --no-patch --no-notes HEAD') do (
+ set odin_version_raw=%%i
+ set GIT_SHA=%%j
+)
if %ERRORLEVEL% equ 0 set compiler_defines=%compiler_defines% -DGIT_SHA=\"%GIT_SHA%\"
:skip_git_hash