mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-23 05:31:29 +00:00
Track unpushed commits as dirty
This commit is contained in:
parent
25e81d073a
commit
9391f179c9
6 changed files with 13 additions and 2 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -22,6 +22,7 @@ lighthouse.config.json
|
||||||
gitBranch.txt
|
gitBranch.txt
|
||||||
gitVersion.txt
|
gitVersion.txt
|
||||||
gitRemotes.txt
|
gitRemotes.txt
|
||||||
|
gitUnpushed.txt
|
||||||
ProjectLighthouse/.vscode/tasks.json
|
ProjectLighthouse/.vscode/tasks.json
|
||||||
ProjectLighthouse/.vscode/launch.json
|
ProjectLighthouse/.vscode/launch.json
|
||||||
logs/Startup.log
|
logs/Startup.log
|
||||||
|
|
|
@ -133,4 +133,5 @@
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=unfavourite/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=unfavourite/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Unheart/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Unheart/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Unpublish/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Unpublish/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Unpushed/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=yourthumb/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=yourthumb/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
|
|
@ -26,6 +26,8 @@ namespace LBPUnion.ProjectLighthouse.Helpers
|
||||||
// linq is a serious and painful catastrophe but its useful so i'm gonna keep using it
|
// linq is a serious and painful catastrophe but its useful so i'm gonna keep using it
|
||||||
Remotes = lines.Select(line => line.Split("\t")[1]).ToArray();
|
Remotes = lines.Select(line => line.Split("\t")[1]).ToArray();
|
||||||
|
|
||||||
|
CommitsOutOfDate = readManifestFile("gitUnpushed.txt").Split('\n').Length;
|
||||||
|
|
||||||
CanCheckForUpdates = true;
|
CanCheckForUpdates = true;
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
|
@ -64,7 +66,8 @@ namespace LBPUnion.ProjectLighthouse.Helpers
|
||||||
public static string CommitHash { get; set; }
|
public static string CommitHash { get; set; }
|
||||||
public static string Branch { get; set; }
|
public static string Branch { get; set; }
|
||||||
public static string FullVersion => $"{ServerStatics.ServerName} {Branch}@{CommitHash} {Build}";
|
public static string FullVersion => $"{ServerStatics.ServerName} {Branch}@{CommitHash} {Build}";
|
||||||
public static bool IsDirty => CommitHash.EndsWith("-dirty") || CommitHash == "invalid" || Branch == "invalid";
|
public static bool IsDirty => CommitHash.EndsWith("-dirty") || CommitsOutOfDate != 0 || CommitHash == "invalid" || Branch == "invalid";
|
||||||
|
public static int CommitsOutOfDate { get; set; }
|
||||||
public static bool CanCheckForUpdates { get; set; }
|
public static bool CanCheckForUpdates { get; set; }
|
||||||
public static string[] Remotes { get; set; }
|
public static string[] Remotes { get; set; }
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
<p><b>CommitHash</b>: @VersionHelper.CommitHash</p>
|
<p><b>CommitHash</b>: @VersionHelper.CommitHash</p>
|
||||||
<p><b>IsDirty</b>: @VersionHelper.IsDirty</p>
|
<p><b>IsDirty</b>: @VersionHelper.IsDirty</p>
|
||||||
<p><b>CanCheckForUpdates</b>: @VersionHelper.CanCheckForUpdates</p>
|
<p><b>CanCheckForUpdates</b>: @VersionHelper.CanCheckForUpdates</p>
|
||||||
|
<p><b>CommitsOutOfDate</b>: @VersionHelper.CommitsOutOfDate</p>
|
||||||
|
|
||||||
<h2>Remotes</h2>
|
<h2>Remotes</h2>
|
||||||
@foreach (string remote in VersionHelper.Remotes)
|
@foreach (string remote in VersionHelper.Remotes)
|
||||||
|
|
|
@ -151,7 +151,7 @@
|
||||||
<div class="ui container">
|
<div class="ui container">
|
||||||
<i class="warning icon"></i>
|
<i class="warning icon"></i>
|
||||||
<span style="font-size: 1.2rem;">Potential License Violation</span>
|
<span style="font-size: 1.2rem;">Potential License Violation</span>
|
||||||
<p>This instance is a public-facing instance that has been modified without the changes committed. You may be in violation of the <a href="https://github.com/LBPUnion/project-lighthouse/blob/main/LICENSE">GNU Affero General Public License v3.0</a>.</p>
|
<p>This instance is a public-facing instance that has been modified without the changes published. You may be in violation of the <a href="https://github.com/LBPUnion/project-lighthouse/blob/main/LICENSE">GNU Affero General Public License v3.0</a>.</p>
|
||||||
<p>If you believe this is an error, please create an issue with the output of <code>git status</code> ran from the root of the server source code in the description on our <a href="https://github.com/LBPUnion/project-lighthouse/issues">issue tracker</a>.</p>
|
<p>If you believe this is an error, please create an issue with the output of <code>git status</code> ran from the root of the server source code in the description on our <a href="https://github.com/LBPUnion/project-lighthouse/issues">issue tracker</a>.</p>
|
||||||
<p>If not, please publish the source code somewhere accessible to your users.</p>
|
<p>If not, please publish the source code somewhere accessible to your users.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -35,12 +35,17 @@
|
||||||
<EmbeddedResource Include="gitRemotes.txt">
|
<EmbeddedResource Include="gitRemotes.txt">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
<None Remove="gitUnpushed.txt"/>
|
||||||
|
<EmbeddedResource Include="gitUnpushed.txt">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</EmbeddedResource>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
|
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
|
||||||
<Exec Command="git describe --long --always --dirty --exclude=\* --abbrev=8 > "$(ProjectDir)/gitVersion.txt""/>
|
<Exec Command="git describe --long --always --dirty --exclude=\* --abbrev=8 > "$(ProjectDir)/gitVersion.txt""/>
|
||||||
<Exec Command="git branch --show-current > "$(ProjectDir)/gitBranch.txt""/>
|
<Exec Command="git branch --show-current > "$(ProjectDir)/gitBranch.txt""/>
|
||||||
<Exec Command="git remote -v > "$(ProjectDir)/gitRemotes.txt""/>
|
<Exec Command="git remote -v > "$(ProjectDir)/gitRemotes.txt""/>
|
||||||
|
<Exec Command="git log --branches --not --remotes --oneline > "$(ProjectDir)/gitUnpushed.txt""/>
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue