stable-diffusion-webui/scripts/dev/prevent_upstream_push.sh
m-cahill 975dda4b56
M03: Test architecture (#2)
* docs(M03): seed M03 plan and toolcalls

Made-with: Cursor

* ci: add repository guardrail, update CONTRIBUTING workflow

Made-with: Cursor

* M03: Test architecture (smoke/quality/nightly)

- Move tests to test/smoke/, scaffold test/quality and test/nightly
- Add pytest.ini with smoke/quality/nightly markers
- Split CI: run_smoke_tests (PR), run_quality_tests (push main), run_nightly_tests (schedule)
- Remove run_tests.yaml
- Add prevent_upstream_push.sh pre-push hook template
- Update CONTRIBUTING.md with hook install and test tier docs
- Add repo and base-branch guardrails to workflows

Made-with: Cursor

* ci: remove obsolete warns_merge_master workflow (Serena uses main)

Made-with: Cursor

* fix: add base_url to pytest.ini for pytest-base-url plugin

Made-with: Cursor

* docs(M03): ledger, run1, audit, summary

Made-with: Cursor

* docs(M03): ledger commit 4ce5cde9

Made-with: Cursor
2026-03-08 18:39:40 -07:00

25 lines
834 B
Bash

#!/usr/bin/env bash
# Prevent pushing to remotes that are not the Serena repository.
# Install: cp scripts/dev/prevent_upstream_push.sh .git/hooks/pre-push && chmod +x .git/hooks/pre-push
#
# This hook receives: $1 = remote name, $2 = URL of remote
# We validate that the push target URL points to m-cahill/serena.
remote_name="$1"
remote_url="$2"
if [[ -z "$remote_url" ]]; then
echo "ERROR: Could not determine push target URL"
exit 1
fi
if [[ "$remote_url" != *"m-cahill/serena"* ]]; then
echo "ERROR: Push target ($remote_name) does not point to m-cahill/serena"
echo " URL: $remote_url"
if [[ "$remote_url" == *"AUTOMATIC1111"* ]] || [[ "$remote_url" == *"stable-diffusion-webui"* ]]; then
echo " Hint: You may be pushing to upstream. Serena development must stay in m-cahill/serena."
fi
exit 1
fi
exit 0