From 32475b63bd39db2e926709286e9a4193b4b49527 Mon Sep 17 00:00:00 2001 From: lexx Date: Fri, 6 Nov 2026 15:57:38 +0200 Subject: [PATCH] Docs: describe the core-mode pre-commit guard Co-Authored-By: Claude Opus 5.5 --- CONTRIBUTE.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTE.md b/CONTRIBUTE.md index 02872c3..6323bb1 100644 --- a/CONTRIBUTE.md +++ b/CONTRIBUTE.md @@ -38,7 +38,9 @@ bin/core-mode repo # back to tagged releases It swaps the `composer.json` / `package.json` wiring, runs `down` with the old mode's Compose wrapper and `up` with the new one, then waits until the entrypoints have re-resolved core. Running it for the mode you're already in skips the edits and just restarts the stack — in repo mode, that's how you pick up a newly pushed tag. -(`3dealer` has `bin/core-mode` and `bin/deploy`; they're app-agnostic, so other consumer apps can copy them as-is.) +**Pre-commit guard.** The first time you run `bin/core-mode local` or `repo`, it sets `git config core.hooksPath .githooks`. That turns on a pre-commit hook (`bin/check-core-mode`) that blocks any commit with local-mode `composer.json`, `package.json` or either lockfile staged. You can keep working in local mode and commit everything else: just leave those four files unstaged (`git restore --staged composer.json composer.lock package.json package-lock.json`). If you already use a custom `core.hooksPath`, `core-mode` leaves it alone and warns you. In that case, call `bin/check-core-mode` from your own hook. + +(`3dealer` has `bin/core-mode`, `bin/check-core-mode`, `.githooks/` and `bin/deploy`; they're app-agnostic, so other consumer apps can copy them as-is.) ### Day to day in local mode