Files
gstack/hosts/qm/scripts/diff-base.sh
T
Garry Tanandcapy-ai[bot] eaf1701da2 QM edition: three gstack skills QM loads on demand (GST-1492) (#4049)
* QM edition: three gstack skills QM loads on demand (GST-1492)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* test: name the QM edition's manifest and shipped script

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* paid lane: classify the QM edition as free-only (no paid case reads qm/)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix: pre-landing review fixes

diff-base.sh names the untracked files past the first 30 (UNTRACKED_MORE) instead of dropping them silently; the gstack-review first step tells QM to read every untracked file.

Review-Finding: p1/outside-voice#1 reader=outside-voice
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* docs: point the QM row in docs/hosts.md at the QM edition

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* test: record the non-behavioral HARNESS_VERSION decision for the qm/** free-only row

CI run 42135033713 failed test/harness-version.test.ts: scripts/test-pr-profile.ts is a pinned shared-harness file and 87ed675 changed it without a decision. The row only classifies qm/ as free-only; no paid case reads qm/.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

---------

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
2026-11-06 00:38:43 +00:00

53 lines
1.9 KiB
Bash

#!/bin/sh
# gstack-review first step: find the base, the merge base and what changed.
# Usage: sh diff-base.sh [base] (POSIX sh and git only)
set -u
if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
echo "NOT_A_GIT_REPO: $(pwd)"
exit 0
fi
no_base() {
echo "BASE: none ($1)"
echo "== uncommitted changes"
git status --short | head -n 40
if git rev-parse --verify --quiet HEAD >/dev/null; then
echo "== diff stat against HEAD"
git diff --stat HEAD --
fi
echo "NEXT: pass the base branch (sh diff-base.sh <base>) or review the uncommitted changes with git diff HEAD"
exit 0
}
base=${1:-}
if [ -z "$base" ]; then
base=$(git symbolic-ref --quiet --short refs/remotes/origin/HEAD 2>/dev/null || true)
fi
if [ -z "$base" ]; then
for candidate in origin/main main origin/master master; do
if git rev-parse --verify --quiet "$candidate^{commit}" >/dev/null; then
base=$candidate
break
fi
done
fi
[ -n "$base" ] || no_base "no origin/HEAD, main or master"
merge_base=$(git merge-base "$base" HEAD 2>/dev/null) || no_base "$base has no merge base with HEAD"
echo "BRANCH: $(git symbolic-ref --quiet --short HEAD 2>/dev/null || echo detached)"
echo "BASE: $base"
echo "MERGE_BASE: $merge_base"
echo "== commits since base"
git log --oneline "$merge_base..HEAD" -- | head -n 30
echo "== diff stat (working tree against merge base)"
git diff --stat "$merge_base" --
untracked=$(git ls-files --others --exclude-standard)
echo "== untracked files"
printf '%s\n' "$untracked" | head -n 30
untracked_count=$(printf '%s\n' "$untracked" | grep -c . || true)
if [ "$untracked_count" -gt 30 ]; then
echo "UNTRACKED_MORE: $((untracked_count - 30)) more untracked files; list them all with git ls-files --others --exclude-standard"
fi
if git diff --quiet "$merge_base" -- && [ -z "$untracked" ]; then
echo "NOTHING_TO_REVIEW"
exit 0
fi
echo "NEXT: git diff $merge_base"