Created
October 13, 2015 10:59
-
-
Save r-lyeh-archived/39133b4c169387987867 to your computer and use it in GitHub Desktop.
generate git info for C++ inclusion
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
:: generate git info for C++ inclusion | |
:: - rlyeh, public domain | |
git rev-list --count --first-parent HEAD > git.hpp | |
set /p REVISION=<git.hpp | |
git rev-parse --abbrev-ref HEAD > git.hpp | |
set /p BRANCH=<git.hpp | |
echo #pragma once > git.hpp | |
echo #define GIT_BRANCH "%BRANCH%" >> git.hpp | |
echo #define GIT_REVISION "%REVISION%" >> git.hpp | |
echo #define GIT_REVISION_NUM %REVISION% >> git.hpp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment