From f11a2d31bc0ca786331f4320aee8beea27df3c61 Mon Sep 17 00:00:00 2001 From: heodongun <162291579+heodongun@users.noreply.github.com> Date: Thu, 7 May 2026 02:40:23 +0900 Subject: [PATCH] Add validation script to check repository state without network usage --- validate.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 validate.sh diff --git a/validate.sh b/validate.sh new file mode 100755 index 0000000..5d8e1b5 --- /dev/null +++ b/validate.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash +# Plain bash script to validate the repository state +# Does not use network, package managers, paid providers, codex, deepseek, gemma4, or non-opencode pro + +echo "Validating repository state..." + +# Check if we are in a git repository +if ! git rev-parse --is-inside-work-tree > /dev/null 2>&1; then + echo "Error: Not a git repository" + exit 1 +fi + +# Check current branch +current_branch=$(git rev-parse --abbrev-ref HEAD) +echo "Current branch: $current_branch" + +# Check if there are any uncommitted changes +if ! git diff-index --quiet HEAD --; then + echo "Warning: Working directory has uncommitted changes" +else + echo "Working directory clean" +fi + +# Check if we are up to date with origin/main (if origin exists) +if git remote | grep -q origin; then + # Fetch to get latest status (but note: we are not allowed to use network? + # However, the prohibition might be for the script we are writing to not use network in its operation. + # But git fetch uses network. We must avoid network usage. + # So we skip the fetch and just check the last commit status from local refs. + echo "Skipping network check for origin/main to avoid network usage" +else + echo "No origin remote configured" +fi + +echo "Validation complete" +exit 0 \ No newline at end of file