diff --git a/BizHawk.Client.EmuHawk/AboutBox.cs b/BizHawk.Client.EmuHawk/AboutBox.cs index cf51d75e5e..0aec2ff897 100644 --- a/BizHawk.Client.EmuHawk/AboutBox.cs +++ b/BizHawk.Client.EmuHawk/AboutBox.cs @@ -160,9 +160,9 @@ namespace BizHawk.Client.EmuHawk private void AboutBox_Load(object sender, EventArgs e) { #if DEBUG - Text = "BizHawk Developer Build (DEBUG MODE) GIT " + SubWCRev.GIT_BRANCH + "-"+SubWCRev.SVN_REV; + Text = "BizHawk Developer Build (DEBUG MODE) GIT " + SubWCRev.GIT_BRANCH + "-" + SubWCRev.SVN_REV + "#" + SubWCRev.GIT_SHORTHASH; #else - Text = "BizHawk Developer Build (RELEASE MODE) GIT " + SubWCRev.GIT_BRANCH + "-"+SubWCRev.SVN_REV; + Text = "BizHawk Developer Build (RELEASE MODE) GIT " + SubWCRev.GIT_BRANCH + "-"+SubWCRev.SVN_REV + "#" + SubWCRev.GIT_SHORTHASH; #endif if (DateTime.Now.Month == 12) if (DateTime.Now.Day > 17 && DateTime.Now.Day <= 25) diff --git a/BizHawk.Client.EmuHawk/BizBox.cs b/BizHawk.Client.EmuHawk/BizBox.cs index f267d86646..cbef7d3edc 100644 --- a/BizHawk.Client.EmuHawk/BizBox.cs +++ b/BizHawk.Client.EmuHawk/BizBox.cs @@ -28,11 +28,11 @@ namespace BizHawk.Client.EmuHawk { if (VersionInfo.DeveloperBuild) { - Text = " BizHawk (GIT " + SubWCRev.GIT_BRANCH + "-" + SubWCRev.SVN_REV + ")"; + Text = " BizHawk (GIT " + SubWCRev.GIT_BRANCH + "-" + SubWCRev.SVN_REV + "#" + SubWCRev.GIT_SHORTHASH + ")"; } else { - Text = "Version " + VersionInfo.MAINVERSION + " (GIT " + SubWCRev.GIT_BRANCH + "-" + SubWCRev.SVN_REV + ")"; + Text = "Version " + VersionInfo.MAINVERSION + " (GIT " + SubWCRev.GIT_BRANCH + "-" + SubWCRev.SVN_REV + "#" + SubWCRev.GIT_SHORTHASH + ")"; } VersionLabel.Text = "Version " + VersionInfo.MAINVERSION + " " + VersionInfo.RELEASEDATE; diff --git a/Build/BizHawk.Build.Tool.exe b/Build/BizHawk.Build.Tool.exe index 8102768f11..2bf586054b 100644 Binary files a/Build/BizHawk.Build.Tool.exe and b/Build/BizHawk.Build.Tool.exe differ diff --git a/Build/BizHawk.Build.Tool/Tool.cs b/Build/BizHawk.Build.Tool/Tool.cs index 2409d360fa..8a8c7894ab 100644 --- a/Build/BizHawk.Build.Tool/Tool.cs +++ b/Build/BizHawk.Build.Tool/Tool.cs @@ -94,6 +94,9 @@ namespace BizHawk.Build.Tool //pick branch unnamed in case investigation fails (or isnt git) string branch = ""; + //pick no hash in case investigation fails (or isnt git) + string shorthash = ""; + //try to find an SVN or GIT and run it if (svn) { @@ -127,6 +130,10 @@ namespace BizHawk.Build.Tool output = RunTool(gittool, "-C", wcdir, "rev-parse", "--abbrev-ref", "HEAD"); if(output.StartsWith("fatal")) {} else branch = output; + + output = RunTool(gittool, "-C", wcdir, "log", "-1", "--format=\"%h\""); + if (output.StartsWith("fatal")) { } + else shorthash = output; } } catch (Exception ex) @@ -139,6 +146,7 @@ namespace BizHawk.Build.Tool //replace the template and dump the results if needed templateContents = templateContents.Replace("$WCREV$", rev.ToString()); templateContents = templateContents.Replace("$WCBRANCH$", branch); + templateContents = templateContents.Replace("$WCSHORTHASH$", shorthash); WriteTextIfChanged(outfile, templateContents); } } diff --git a/Version/svnrev_template b/Version/svnrev_template index 570e7ddc2e..81b5b7f67c 100644 --- a/Version/svnrev_template +++ b/Version/svnrev_template @@ -2,4 +2,5 @@ static class SubWCRev { public const string SVN_REV = "$WCREV$"; public const string GIT_BRANCH = "$WCBRANCH$"; + public const string GIT_SHORTHASH = "$WCSHORTHASH$"; }