File tree 1 file changed +10
-6
lines changed
1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -3,22 +3,26 @@ SETLOCAL
3
3
4
4
set STATUS = Clean
5
5
for /f " usebackq delims=" %%i in (`git status --untracked-files^ =no --porcelain`) do (
6
- echo Uncommitted change^ (s^ ): %%i
7
- if [%% i] NEQ [] set STATUS = Dirty
6
+ if [%%i ] NEQ [] (
7
+ set STATUS = Dirty
8
+ echo Uncommitted change^ (s^ ): %%i
9
+ )
8
10
)
9
11
12
+ if " %STATUS% " == " Clean" (echo Nothing to commit, working tree clean.)
13
+
10
14
for /f " usebackq delims=" %%i in (`git describe --abbrev^ =0`) do set TAG = %%i
11
15
for /f " usebackq delims=" %%i in (`git rev-list --abbrev-commit -n 1 %TAG% `) do set TAGCOMMIT = %%i
12
16
for /f " usebackq delims=" %%i in (`git rev-list --abbrev-commit -n 1 HEAD`) do set HEADCOMMIT = %%i
13
17
14
18
if " %HEADCOMMIT% " == " %TAGCOMMIT% " (
15
- echo const char CURRENT_GAMECORE_VERSION[] = " %TAG% %STATUS% " ; //autogenerated, do not commit this file! > %~dp0 %commit_id.inc
16
- echo Version identifier will be " %TAG% %STATUS% "
19
+ echo const char CURRENT_GAMECORE_VERSION[] = " %TAG% %STATUS% " ; //autogenerated, do not commit this file! > %~dp0 %commit_id.inc
20
+ echo Version identifier will be " %TAG% %STATUS% "
17
21
)
18
22
19
23
if " %HEADCOMMIT% " NEQ " %TAGCOMMIT% " (
20
- echo const char CURRENT_GAMECORE_VERSION[] = " %TAG% %HEADCOMMIT% %STATUS% " ; //autogenerated, do not commit this file! > %~dp0 %commit_id.inc
21
- echo Version identifier will be " %TAG% %HEADCOMMIT% %STATUS% "
24
+ echo const char CURRENT_GAMECORE_VERSION[] = " %TAG% %HEADCOMMIT% %STATUS% " ; //autogenerated, do not commit this file! > %~dp0 %commit_id.inc
25
+ echo Version identifier will be " %TAG% %HEADCOMMIT% %STATUS% "
22
26
)
23
27
24
28
ENDLOCAL
You can’t perform that action at this time.
0 commit comments