Skip to content

chore(pre-commit): require GPG/SSH-signed commits on push#521

Merged
mvillmow merged 1 commit into
mainfrom
chore/require-signed-commits-2026-05-16
May 16, 2026
Merged

chore(pre-commit): require GPG/SSH-signed commits on push#521
mvillmow merged 1 commit into
mainfrom
chore/require-signed-commits-2026-05-16

Conversation

@mvillmow
Copy link
Copy Markdown
Contributor

Summary

Adds a local pre-push hook that runs git verify-commit over every commit being pushed. Rejects unsigned, bad, or revoked signatures.

Org-wide rollout — companion to HomericIntelligence/ProjectMnemosyne#1718 (pilot).

How it works

  • pre-commit framework now installs into both pre-commit and pre-push via default_install_hook_types.
  • On git push, the hook reads stdin (<local_ref> <local_sha> <remote_ref> <remote_sha>) and verifies every commit in the range.
  • Statuses (from git log --format='%G?'): G/U pass; N/B/R/X/Y/E fail.
  • Manual: pre-commit run --hook-stage pre-push --all-files.

After merging

Each developer must re-run pre-commit install once. Without it, git push still works (no in-repo enforcement of installation).

Bypass

git push --no-verify (rare — e.g. CI fixup worktrees without gpg-agent).

Test plan

  • CI passes (hook is push-time only, no CI impact).
  • After merge, pre-commit install wires both hooks.

Adds a local pre-push hook that runs git verify-commit over every
commit in the push range. Rejects pushes containing unsigned, bad,
or revoked signatures (statuses N/B/R/X/Y/E); accepts G (good) and
U (good but unknown trust DB locally).

Behavior:
- pre-commit framework now installs into BOTH pre-commit and pre-push
  via default_install_hook_types. Devs need to re-run `pre-commit
  install` once after pulling main.
- Bypass intentionally with `git push --no-verify`.
- Clear error message points to the re-sign recipe.

Companion to HomericIntelligence/ProjectMnemosyne#1718 (pilot).
@mvillmow mvillmow merged commit 6b49626 into main May 16, 2026
26 checks passed
@mvillmow mvillmow deleted the chore/require-signed-commits-2026-05-16 branch May 16, 2026 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant