-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIN32] fixed: git revision in build setup file name.
refactored the git version extraction code to be shared between the update_git_rev.bat and BuildSetup.bat scripts.
- Loading branch information
CrystalP
authored and
CrystalP
committed
Jan 15, 2011
1 parent
c67f101
commit f833d1e
Showing
3 changed files
with
39 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
@echo off | ||
|
||
rem Batch file output: %GIT_REV% variable, containing the git revision | ||
|
||
rem Use tgit.exe of TortoiseGit if available | ||
SET GITEXE="tgit.exe" | ||
%GITEXE% --version > NUL 2>&1 | ||
if errorlevel 1 goto :notgit | ||
GOTO :extract | ||
|
||
:notgit | ||
|
||
rem Fallback on msysgit - must be in the path | ||
SET GITEXE="git.exe" | ||
%GITEXE% --help > NUL 2>&1 | ||
if errorlevel 1 goto :nogit | ||
GOTO :extract | ||
|
||
:nogit | ||
|
||
rem Failure - no git tool to extract information. | ||
SET GIT_REV=Unknown | ||
GOTO :done | ||
|
||
:extract | ||
|
||
set oldCurrentDir=%CD% | ||
cd ..\.. | ||
FOR /F "tokens=1 delims= " %%A IN ('%GITEXE% rev-parse --short HEAD') DO SET GIT_REV=%%A | ||
cd %oldCurrentDir% | ||
|
||
:done | ||
|
||
SET GITEXE= |