Have About dialog copy full Git commit hash to clipboard
and use full hash in GitHub web app URI
This commit is contained in:
parent
e5dc04dc37
commit
3490b544b4
|
@ -49,7 +49,7 @@ public class VersionInfoGenerator : ISourceGenerator
|
|||
|
||||
var rev = ExecuteGitWithArguments($"-C {projectDir} rev-list HEAD --count") ?? string.Empty;
|
||||
var branch = ExecuteGitWithArguments($"-C {projectDir} rev-parse --abbrev-ref HEAD") ?? "master";
|
||||
var shortHash = ExecuteGitWithArguments($"-C {projectDir} log -1 --format=\"%h\"") ?? "000000000";
|
||||
var hash = ExecuteGitWithArguments($"-C {projectDir} log -1 --format=\"%H\"") ?? "0000000000000000000000000000000000000000";
|
||||
|
||||
// Generated source code
|
||||
string source = $@"namespace BizHawk.Common
|
||||
|
@ -58,7 +58,8 @@ public class VersionInfoGenerator : ISourceGenerator
|
|||
{{
|
||||
public const string SVN_REV = ""{rev}"";
|
||||
public const string GIT_BRANCH = ""{branch}"";
|
||||
public const string GIT_SHORTHASH = ""{shortHash}"";
|
||||
public const string GIT_HASH = ""{hash}"";
|
||||
public const string GIT_SHORTHASH = ""{hash.Substring(startIndex: 0, length: 9)}"";
|
||||
}}
|
||||
}}
|
||||
";
|
||||
|
|
Binary file not shown.
|
@ -58,9 +58,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
=> Process.Start((string) ((Control) sender).Tag);
|
||||
|
||||
private void btnCopyHash_Click(object sender, EventArgs e)
|
||||
{
|
||||
Clipboard.SetText(VersionInfo.GIT_SHORTHASH);
|
||||
}
|
||||
=> Clipboard.SetText(VersionInfo.GIT_HASH);
|
||||
|
||||
private void linkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
=> Process.Start(VersionInfo.BizHawkContributorsListURI);
|
||||
|
|
|
@ -41,7 +41,7 @@ namespace BizHawk.Common
|
|||
}
|
||||
|
||||
public static (string Label, string TargetURI) GetGitCommitLink()
|
||||
=> ($"Commit :{GIT_BRANCH}@{GIT_SHORTHASH}", $"https://github.com/TASEmulators/BizHawk/commit/{GIT_SHORTHASH}");
|
||||
=> ($"Commit :{GIT_BRANCH}@{GIT_SHORTHASH}", $"https://github.com/TASEmulators/BizHawk/commit/{GIT_HASH}");
|
||||
|
||||
public static string GetFullVersionDetails()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue