mirror of
https://github.com/bherbruck/solidcraft.git
synced 2026-11-17 06:00:56 +00:00
916b91e8d0
solidcore's main at c0d3cc0124, rewritten to one commit per same-author run per PR (2,800 commits, author credit kept; tree identical). Full original history: tangency-labs/solidcore archive/full-history. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> git-subtree-dir: solidcore git-subtree-mainline:44525da669git-subtree-split:c440e5f892
48 lines
1.9 KiB
Bash
Executable File
Vendored
48 lines
1.9 KiB
Bash
Executable File
Vendored
#!/usr/bin/env bash
|
|
# Fetch jyviko's exact-ground-truth surface/surface intersection corpus
|
|
# (https://github.com/jyviko/ssi-corpus, MIT OR Apache-2.0) at a pinned commit into
|
|
# corpus/ssi/ (gitignored; never commit case data). Idempotent: re-running leaves an
|
|
# existing checkout at the pinned commit.
|
|
#
|
|
# The corpus is data only: goldens --ssi-corpus reads its cases/data/*.json and never
|
|
# executes anything from it.
|
|
#
|
|
# Usage: scripts/fetch-ssi-corpus.sh [dest] (default <repo>/corpus/ssi)
|
|
# Used by: cargo run --profile goldens -p goldens -- --ssi-corpus
|
|
set -euo pipefail
|
|
|
|
URL="https://github.com/jyviko/ssi-corpus.git"
|
|
# Full SHA (b04c8a6): a short prefix could later be matched by a crafted commit.
|
|
COMMIT="b04c8a6093a8b3505d865d1dd874ec3879ccb1f9"
|
|
|
|
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
ROOT="$(cd "$HERE/.." && pwd)"
|
|
DEST="${1:-$ROOT/corpus/ssi}"
|
|
|
|
if [ -d "$DEST/.git" ]; then
|
|
origin="$(git -C "$DEST" remote get-url origin 2>/dev/null || true)"
|
|
if [ "$origin" != "$URL" ]; then
|
|
echo "fetch-ssi-corpus: $DEST has origin '$origin', expected $URL; remove it and re-run" >&2
|
|
exit 1
|
|
fi
|
|
if [ -n "$(git -C "$DEST" status --porcelain --untracked-files=all)" ]; then
|
|
echo "fetch-ssi-corpus: $DEST has local changes; remove it and re-run" >&2
|
|
exit 1
|
|
fi
|
|
if [ "$(git -C "$DEST" rev-parse HEAD)" = "$COMMIT" ]; then
|
|
echo "ssi-corpus already at $COMMIT in $DEST"
|
|
exit 0
|
|
fi
|
|
else
|
|
if [ -e "$DEST" ]; then
|
|
echo "fetch-ssi-corpus: $DEST exists and is not a git checkout; remove it and re-run" >&2
|
|
exit 1
|
|
fi
|
|
mkdir -p "$(dirname "$DEST")"
|
|
git clone --quiet --no-checkout --filter=blob:none "$URL" "$DEST"
|
|
fi
|
|
git -C "$DEST" fetch --quiet origin "$COMMIT"
|
|
git -C "$DEST" -c advice.detachedHead=false checkout --quiet --detach "$COMMIT"
|
|
[ "$(git -C "$DEST" rev-parse HEAD)" = "$COMMIT" ] || { echo "fetch-ssi-corpus: pin mismatch" >&2; exit 1; }
|
|
echo "ssi-corpus at $COMMIT in $DEST"
|