3 "%~dp0\..\..\..\Prerequisites\CEcho\cecho.exe" cyan "\n==========================================================================="
4 "%~dp0\..\..\..\Prerequisites\CEcho\cecho.exe" cyan "Detecting Git revision..."
5 "%~dp0\..\..\..\Prerequisites\CEcho\cecho.exe" cyan "===========================================================================\n"
7 :: ---------------------------------------------------------------------------
9 :: ---------------------------------------------------------------------------
11 call "%~dp0\_paths.bat"
14 :: ---------------------------------------------------------------------------
16 :: ---------------------------------------------------------------------------
24 :: ---------------------------------------------------------------------------
25 :: DETECT THE GIT REVISION
26 :: ---------------------------------------------------------------------------
28 for /f "usebackq tokens=1" %%i in (`"%PATH_GITWIN%\bin\git.exe" rev-parse --abbrev-ref HEAD`) do (
29 set "GIT_REV_NAME=%%~i"
32 for /f "usebackq tokens=1" %%i in (`"%PATH_GITWIN%\bin\git.exe" rev-parse --short HEAD`) do (
33 set "GIT_REV_HASH=%%~i"
36 for /f "usebackq tokens=1" %%i in (`"%PATH_GITWIN%\bin\git.exe" rev-list --count HEAD`) do (
37 set "GIT_REV_NMBR=%%~i"
40 for /f "usebackq tokens=1,2" %%i in (`"%PATH_GITWIN%\bin\git.exe" log -1 --format^=%%ci HEAD`) do (
41 set "GIT_REV_DATE=%%~i"
42 set "GIT_REV_TIME=%%~j"
45 :: ------------------------------------------
47 :: ------------------------------------------
49 if "%GIT_REV_NAME%"=="" goto git_rev_incomplete
50 if "%GIT_REV_HASH%"=="" goto git_rev_incomplete
51 if "%GIT_REV_NMBR%"=="" goto git_rev_incomplete
52 if "%GIT_REV_DATE%"=="" goto git_rev_incomplete
53 if "%GIT_REV_TIME%"=="" goto git_rev_incomplete
57 "%~dp0\..\..\..\Prerequisites\CEcho\cecho.exe" red "\nFailed to determine the current Git revision!\n"
60 :: ------------------------------------------
62 :: ------------------------------------------
65 "%~dp0\..\..\..\Prerequisites\CEcho\cecho.exe" yellow "Git revision: %GIT_REV_NAME%+%GIT_REV_NMBR%-%GIT_REV_HASH% [%GIT_REV_DATE%]"