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:
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
# UTF-8 first-parent log for HSchool.Server. Keep in sync with embed-changelog.ps1.
|
||||
set -e
|
||||
RepoRoot=$1
|
||||
Output=$2
|
||||
if [ -z "$RepoRoot" ] || [ -z "$Output" ]; then
|
||||
echo "usage: embed-changelog.sh <repo-root> <output>" >&2
|
||||
exit 1
|
||||
fi
|
||||
mkdir -p "$(dirname "$Output")"
|
||||
sha=
|
||||
log=
|
||||
if sha=$(git -C "$RepoRoot" rev-parse HEAD 2>/dev/null) && [ "${#sha}" -eq 40 ]; then
|
||||
log=$(git -C "$RepoRoot" -c core.quotepath=false log --first-parent --encoding=UTF-8 --pretty=format:%H%x1f%cI%x1f%s) || log=
|
||||
else
|
||||
sha=
|
||||
fi
|
||||
{
|
||||
printf '%s\n' "$sha"
|
||||
if [ -n "$log" ]; then
|
||||
printf '%s\n' "$log"
|
||||
fi
|
||||
} > "$Output"
|
||||
Reference in New Issue
Block a user