The repo guide already prescribed the seven-rules format but did not rule out the Conventional-Commits alternative, and recent history has drifted into mixing both styles. Several existing commits use a "fix(scope): ..." prefix that the project does not consume for any tooling (no changelog generator, no semantic release, no commit-lint), so the prefix only adds noise and hurts log readability. Add an alwaysApply Cursor rule that explicitly bans Conventional Commits and restates the seven-rules format with concrete good and bad examples. Update contrib/claude/commit.md with the same prohibition so the documentation and the rule agree, and cross-link both from the existing signing rule so an agent reading git-commit-signing.mdc lands on the style rule too. Signed-off-by: Émile Ré <emile@probo.com>
36 lines
1.3 KiB
Plaintext
36 lines
1.3 KiB
Plaintext
---
|
|
description: Always sign commits with -s -S (DCO trailer + GPG/SSH signature)
|
|
alwaysApply: true
|
|
---
|
|
|
|
# Git Commit Signing
|
|
|
|
All commits in this repository **must** be signed with both `-s` and `-S`:
|
|
|
|
- `-s` adds a `Signed-off-by` trailer (DCO).
|
|
- `-S` creates a GPG/SSH signature.
|
|
|
|
Pass both flags every time, even when the user's `git` config already sets `format.signoff` or `commit.gpgsign` — relying on local config silently fails on machines where it isn't set.
|
|
|
|
```bash
|
|
# GOOD
|
|
git commit -s -S -m "$(cat <<'EOF'
|
|
Subject line in imperative mood
|
|
|
|
Body explaining what and why, wrapped at 72 chars.
|
|
EOF
|
|
)"
|
|
|
|
# BAD — missing -S, signature absent even if Signed-off-by trailer is present
|
|
git commit -s -m "..."
|
|
|
|
# BAD — neither flag
|
|
git commit -m "..."
|
|
```
|
|
|
|
The same applies to `git commit --amend`: pass `-s -S` (or `--amend --no-edit -s -S` when keeping the message). The commit author must remain the human responsible for the change — do not add `Co-Authored-By` trailers crediting bots.
|
|
|
|
Verify with `git log -1 --show-signature` after committing; the output should show a valid signature **and** the `Signed-off-by:` trailer.
|
|
|
|
See [`contrib/claude/commit.md`](../../contrib/claude/commit.md) for full commit conventions and [`.cursor/rules/git-commit-style.mdc`](git-commit-style.mdc) for message format rules (seven-rules style, no Conventional Commits).
|