mirror of
https://github.com/usestrix/strix.git
synced 2026-10-28 06:23:07 +00:00
docs(skills): fail loudly when no diff base resolves
Never fall back to HEAD~1 - on a multi-commit branch it scans only the last commit and earlier changes can pass unscanned. Require an explicit base (or the diff-base-free --instruction verification) instead.
This commit is contained in:
parent
a73b022f26
commit
d0341016ae
2 changed files with 10 additions and 2 deletions
|
|
@ -85,7 +85,12 @@ if [ -z "$BASE_BRANCH" ]; then
|
|||
BASE_BRANCH="${BASE_BRANCH#origin/}"
|
||||
fi
|
||||
DIFF_BASE="origin/${BASE_BRANCH:-main}"
|
||||
git rev-parse --verify --quiet "$DIFF_BASE" >/dev/null || DIFF_BASE="HEAD~1"
|
||||
# Fail loudly rather than silently narrowing scope (e.g. to HEAD~1, which on a
|
||||
# multi-commit branch would scan only the last commit and let earlier ones pass).
|
||||
if ! git rev-parse --verify --quiet "$DIFF_BASE" >/dev/null; then
|
||||
echo "Cannot resolve diff base '$DIFF_BASE'. Fetch the base branch (git fetch origin <base>) or set --diff-base explicitly." >&2
|
||||
exit 1
|
||||
fi
|
||||
strix -n -t ./ --scan-mode quick --scope-mode diff --diff-base "$DIFF_BASE" --max-budget 10
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,10 @@ if [ -z "$DIFF_BASE" ]; then
|
|||
git rev-parse --verify --quiet "$b" >/dev/null && DIFF_BASE="$b" && break
|
||||
done
|
||||
fi
|
||||
DIFF_BASE="${DIFF_BASE:-HEAD~1}"
|
||||
# No silent fallback: a guess like HEAD~1 would cover only the last commit of a
|
||||
# multi-commit fix branch. If no base resolves, ask the user for the base branch
|
||||
# (or use the focused --instruction verification below, which needs no diff base).
|
||||
[ -n "$DIFF_BASE" ] || { echo "Set DIFF_BASE to the branch your fix will merge into." >&2; exit 1; }
|
||||
strix -n -t ./ --scan-mode quick --scope-mode diff --diff-base "$DIFF_BASE" --max-budget 5
|
||||
|
||||
# Or re-test with the original finding as focus (no diff base needed)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue