Show unseen Server commits after login.

Bake first-parent git log at Server build and remember the SHA in a browser cookie.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Leonid Pershin
2026-08-20 11:43:36 +03:00
co-authored by Cursor
parent 1e7014cabd
commit 449be4e0ea
20 changed files with 751 additions and 1 deletions
+40
View File
@@ -0,0 +1,40 @@
# UTF-8 first-parent log for HSchool.Server. Keep in sync with embed-changelog.sh.
param(
[Parameter(Mandatory = $true)]
[string] $RepoRoot,
[Parameter(Mandatory = $true)]
[string] $Output
)
$ErrorActionPreference = "Stop"
$dir = Split-Path -Parent $Output
if (-not (Test-Path -LiteralPath $dir)) {
New-Item -ItemType Directory -Path $dir | Out-Null
}
$sha = ""
$log = ""
Push-Location -LiteralPath $RepoRoot
try {
$sha = (git rev-parse HEAD 2>$null | Out-String).Trim()
if ($LASTEXITCODE -ne 0 -or $sha.Length -ne 40) {
$sha = ""
}
elseif ($sha.Length -eq 40) {
$log = git -c core.quotepath=false log --first-parent --encoding=UTF-8 --pretty=format:%H%x1f%cI%x1f%s
if ($LASTEXITCODE -ne 0) {
$log = ""
}
}
}
finally {
Pop-Location
}
$text = $sha + "`n"
if (-not [string]::IsNullOrEmpty($log)) {
$text += $log.TrimEnd() + "`n"
}
[System.IO.File]::WriteAllText($Output, $text, [System.Text.UTF8Encoding]::new($false))