File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -81,6 +81,20 @@ only the human author. Hooks are auto-installed by `make setup` via
8181make hooks
8282```
8383
84+ ** Cursor / IDE commits:** some editors inject ` Co-authored-by: Cursor ` via their
85+ own git hooks. Use the clean commit helper to bypass IDE hooks while keeping
86+ lefthook checks on normal commits:
87+
88+ ``` bash
89+ ./scripts/commit-clean.sh -m " fix(scope): your message"
90+ ```
91+
92+ ** After a history rewrite:** reset stale local SHAs with:
93+
94+ ``` bash
95+ ./scripts/sync-clone.sh
96+ ```
97+
8498## Commit signing
8599
86100Signed commits are required in this repo.
Original file line number Diff line number Diff line change @@ -205,10 +205,19 @@ compat-test: ## Validate testdata/compatibility-matrix.json and report the 'next
205205compat-check : # # Strict validation — non-zero exit if any component lacks a version.
206206 @go run ./cmd/compat-test -matrix=next -strict -file=testdata/compatibility-matrix.json
207207
208- .PHONY : hooks
208+ .PHONY : hooks sync-submodules sync-clone
209209hooks : # # Install git hooks via lefthook (formatting, linting, conventional commits).
210210 @command -v lefthook > /dev/null 2>&1 || (echo " install: go install github.com/evilmartians/lefthook@latest" && exit 1)
211211 lefthook install
212+
213+ sync-submodules : # # Fetch and checkout latest origin/main for all external/ submodules.
214+ git submodule foreach ' git fetch origin && git checkout origin/main 2>/dev/null || git checkout origin/HEAD'
215+ @echo " Submodule heads:"
216+ @git submodule status
217+
218+ sync-clone : # # Hard-reset hawk and submodules to origin/main (post history rewrite).
219+ @chmod +x scripts/sync-clone.sh scripts/commit-clean.sh
220+ @./scripts/sync-clone.sh
212221# === Cross-platform binary targets (add after existing 'build' target) ===
213222
214223.PHONY : build-all build-static size-check
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ # Commit without IDE-injected Co-authored-by trailers (Cursor, etc.).
3+ # Usage: ./scripts/commit-clean.sh [-m "message"] [other git commit args...]
4+ set -euo pipefail
5+
6+ cd " $( git rev-parse --show-toplevel) "
7+ exec git -c core.hooksPath=/dev/null commit " $@ "
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ # Hard-reset hawk and all external/ submodules to origin/main.
3+ # Use after a history rewrite or when your clone has stale SHAs.
4+ set -euo pipefail
5+
6+ cd " $( git rev-parse --show-toplevel) "
7+
8+ echo " ==> Fetching origin"
9+ git fetch origin
10+
11+ echo " ==> Resetting hawk to origin/main"
12+ git checkout main
13+ git reset --hard origin/main
14+
15+ echo " ==> Updating submodules"
16+ git submodule update --init --recursive
17+ git submodule foreach ' git fetch origin && git checkout origin/main 2>/dev/null || git checkout origin/HEAD'
18+
19+ echo " ==> Done. hawk: $( git rev-parse --short HEAD) "
20+ git submodule status
You can’t perform that action at this time.
0 commit comments