Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,26 @@ refactor!: rename ClientV1 to Client (BREAKING CHANGE)
```

**Co-authors:** do not add `Co-authored-by:` trailers. Commits should list
only the human author. Optional local hook:
only the human author. Install hooks with:

```bash
git config core.hooksPath .githooks
make hooks
```

This enables lefthook (format/lint/conventional commits) and the tracked
`.githooks/prepare-commit-msg` strip hook.

**Cursor / IDE commits:** some editors inject `Co-authored-by: Cursor` via their
own git hooks. Use:

```bash
./scripts/commit-clean.sh -m "fix(scope): your message"
```

**After a history rewrite:** reset stale local SHAs with:

```bash
./scripts/sync-clone.sh
```

## Pull request checklist
Expand Down
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ clean: ## Remove build artefacts.
help: ## Show this help.
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'

.PHONY: hooks
hooks:
.PHONY: hooks sync-clone
hooks: ## Install git hooks (lefthook + tracked .githooks prepare-commit-msg).
@command -v lefthook >/dev/null 2>&1 || (echo "install: go install github.com/evilmartians/lefthook@latest" && exit 1)
git config core.hooksPath .githooks
lefthook install

sync-clone: ## Hard-reset eyrie to origin/main (post history rewrite).
@chmod +x scripts/sync-clone.sh scripts/commit-clean.sh
@./scripts/sync-clone.sh
7 changes: 7 additions & 0 deletions scripts/commit-clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
# Commit without IDE-injected Co-authored-by trailers (Cursor, etc.).
# Usage: ./scripts/commit-clean.sh [-m "message"] [other git commit args...]
set -euo pipefail

cd "$(git rev-parse --show-toplevel)"
exec git -c core.hooksPath=/dev/null commit "$@"
14 changes: 14 additions & 0 deletions scripts/sync-clone.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash
# Hard-reset eyrie to origin/main. Use after a history rewrite or stale SHAs.
set -euo pipefail

cd "$(git rev-parse --show-toplevel)"

echo "==> Fetching origin"
git fetch origin

echo "==> Resetting eyrie to origin/main"
git checkout main
git reset --hard origin/main

echo "==> Done. eyrie: $(git rev-parse --short HEAD)"
Loading