Something went wrong. Try again.
[Mirror] Libreopolis is a cross-platform city simulation game fully compatible with SimCity 2000. gitlab.com/conasg/libreopolis
Something went wrong. Try again.
921 B · 24 lines
12345678910111213141516171819202122232425#!/bin/sh# Guard against committing local planning/scratch documents into this (public) repo.# Catches force-added files and anything that looks like an ephemeral plan, even if# it slipped past .gitignore. Bypass intentionally with: git commit --no-verify## This hook is local (.git/hooks is not cloned). Reinstall on a fresh clone with# scripts/install-hooks.sh.
blocked=$(git diff --cached --name-only --diff-filter=AM | grep -E \ -e '(^|/)notes/' \ -e '_PLAN\.md$' \ -e '-plan\.md$' \ -e '\.plan\.md$' \ -e '\.scratch\.md$' \ -e '(^|/)SCRATCH_.*\.md$')
if [ -n "$blocked" ]; then echo "pre-commit: refusing to commit local planning/scratch docs:" >&2 echo "$blocked" | sed 's/^/ /' >&2 echo >&2 echo " These belong under notes/ (git-ignored) and should not be published." >&2 echo " If this is deliberate, re-run with: git commit --no-verify" >&2 exit 1fi