Remove hash from revision description for cmake and windows.

This commit is contained in:
Jordan Woyak 2011-08-22 20:06:17 -05:00
parent 6a80b9989a
commit 1528c95fe9
2 changed files with 8 additions and 7 deletions

View File

@ -54,9 +54,13 @@ if(GIT_FOUND AND NOT DOLPHIN_WC_REVISION)
OUTPUT_VARIABLE DOLPHIN_WC_REVISION
OUTPUT_STRIP_TRAILING_WHITESPACE)
# defines DOLPHIN_WC_DESCRIBE
EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} describe --always --dirty
EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} describe --always --long --dirty
OUTPUT_VARIABLE DOLPHIN_WC_DESCRIBE
OUTPUT_STRIP_TRAILING_WHITESPACE)
# remove hash from description
STRING(REGEX REPLACE "-[^-]+(-dirty)?$" "\\1" DOLPHIN_WC_DESCRIBE "${DOLPHIN_WC_DESCRIBE}")
# defines DOLPHIN_WC_BRANCH
EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
OUTPUT_VARIABLE DOLPHIN_WC_BRANCH

View File

@ -3,7 +3,7 @@ var oFS = new ActiveXObject("Scripting.FileSystemObject");
var outfile = "./Src/scmrev.h";
var cmd_revision = " rev-parse HEAD";
var cmd_describe = " describe --always --dirty";
var cmd_describe = " describe --always --long --dirty";
var cmd_branch = " rev-parse --abbrev-ref HEAD";
function GetGitExe()
@ -56,13 +56,10 @@ var gitexe = GetGitExe();
var revision = GetFirstStdOutLine(gitexe + cmd_revision);
var describe = GetFirstStdOutLine(gitexe + cmd_describe);
var branch = GetFirstStdOutLine(gitexe + cmd_branch);
var isMaster = 0
var isMaster = +("master" == branch);
// remove hash from description
describe = describe.replace(/-g\w+/, '');
if (branch == "master")
isMaster = 1
describe = describe.replace(/-[^-]+(-dirty)?$/, '$1');
var out_contents =
"#define SCM_REV_STR \"" + revision + "\"\n" +