Skip to content

Commit

Permalink
[WIN] change git exe priority order
Browse files Browse the repository at this point in the history
Try msysgit first, as it's a direct port of the official tool.
Newer msysgit installs a wrapper accessible in the path, try that first,
then git.exe if found, and last tortoise git command line tool tgit.exe.
  • Loading branch information
CrystalP authored and CrystalP committed Jan 2, 2012
1 parent 082694e commit 56f993c
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions project/Win32BuildSetup/extract_git_rev.bat
Expand Up @@ -4,26 +4,27 @@ REM Batch file output: %GIT_REV% variable, containing the git revision

SET GIT_REV=unknown

REM Use tgit.exe of TortoiseGit if available
SET GITEXE=tgit.exe
%GITEXE% --version > NUL 2>&1
IF errorlevel 9009 IF NOT errorlevel 9010 GOTO :notgit

REM Try wrapped msysgit - must be in the path
SET GITEXE=git.cmd
CALL %GITEXE% --help > NUL 2>&1
IF errorlevel 1 GOTO nowrapmsysgit
GOTO :extract

:notgit
:nowrapmsysgit

REM Fallback on msysgit - must be in the path
REM Fallback on regular msysgit - must be in the path
SET GITEXE=git.exe
%GITEXE% --help > NUL 2>&1
IF errorlevel 9009 IF NOT errorlevel 9010 GOTO :nomsysgit
IF errorlevel 9009 IF NOT errorlevel 9010 GOTO nomsysgit
GOTO :extract

:nomsysgit

REM Fallback on wrapped msysgit - must be in the path
SET GITEXE=git.cmd
CALL %GITEXE% --help > NUL 2>&1
IF errorlevel 1 GOTO :done
REM Fallback on tgit.exe of TortoiseGit if available
SET GITEXE=tgit.exe
%GITEXE% --version > NUL 2>&1
IF errorlevel 9009 IF NOT errorlevel 9010 GOTO done
GOTO :extract


Expand Down

0 comments on commit 56f993c

Please sign in to comment.