Skip to content

Commit 28e7203

Browse files
authored
Print branch info to command line (#529)
1 parent 1dee7b9 commit 28e7203

File tree

5 files changed

+27
-3
lines changed

5 files changed

+27
-3
lines changed

BitFaster.Caching.HitRateAnalysis/BitFaster.Caching.HitRateAnalysis.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
<PackageReference Include="EasyConsole" Version="1.1.0">
2424
<NoWarn>NU1701</NoWarn>
2525
</PackageReference>
26+
<PackageReference Include="GitInfo" Version="3.3.3">
27+
<PrivateAssets>all</PrivateAssets>
28+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
29+
</PackageReference>
2630
<PackageReference Include="MathNet.Numerics" Version="5.0.0" />
2731
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.0.0" />
2832
<PackageReference Include="Plotly.NET.CSharp" Version="0.11.1" />

BitFaster.Caching.HitRateAnalysis/Program.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Threading.Tasks;
3+
using BitFaster.Caching.HitRateAnalysis;
34
using BitFaster.Caching.HitRateAnalysis.Arc;
45

56
var menu = new EasyConsole.Menu()
@@ -10,4 +11,5 @@
1011
.Add("Arc Search", () => new BitFaster.Caching.HitRateAnalysis.Arc.Runner(RunnerConfig.Search).Run().Wait())
1112
.Add("Arc OLTP", () => new BitFaster.Caching.HitRateAnalysis.Arc.Runner(RunnerConfig.Oltp).Run().Wait());
1213

14+
Splash.Display();
1315
menu.Display();
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using System;
2+
3+
namespace BitFaster.Caching.HitRateAnalysis
4+
{
5+
internal static class Splash
6+
{
7+
public static void Display()
8+
{
9+
string branch = $"({ThisAssembly.Git.Branch}" + (ThisAssembly.Git.IsDirty ? " dirty)" : ")");
10+
11+
Console.WriteLine($"Hit Rate Analysis {ThisAssembly.Git.BaseTag} {ThisAssembly.Git.Commit} {branch}");
12+
Console.WriteLine();
13+
}
14+
}
15+
}

BitFaster.Caching.ThroughputAnalysis/BitFaster.Caching.ThroughputAnalysis.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
<PackageReference Include="EasyConsole" Version="1.1.0">
2323
<NoWarn>NU1701</NoWarn>
2424
</PackageReference>
25+
<PackageReference Include="GitInfo" Version="3.3.3">
26+
<PrivateAssets>all</PrivateAssets>
27+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
28+
</PackageReference>
2529
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.0.0" />
2630
<PackageReference Include="Plotly.NET" Version="4.2.0" />
2731
<PackageReference Include="Plotly.NET.ImageExport" Version="5.0.1" />

BitFaster.Caching.ThroughputAnalysis/Host.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ public class Host
88
{
99
public static void PrintInfo()
1010
{
11-
var Reference = typeof(Host).Assembly;
12-
var Version = Reference.GetName().Version;
11+
string branch = $"({ThisAssembly.Git.Branch}" + (ThisAssembly.Git.IsDirty ? " dirty)" : ")");
1312

14-
Console.WriteLine($"Throughput Analysis {Version}");
13+
Console.WriteLine($"Throughput Analysis {ThisAssembly.Git.BaseTag} {ThisAssembly.Git.Commit} {branch}");
1514

1615
var hostinfo = HostEnvironmentInfo.GetCurrent();
1716

0 commit comments

Comments
 (0)