Add DCO sign-off hook#2
Merged
Merged
Conversation
OpenVox projects require DCO sign-off. Relying on remembering -s means it gets forgotten exactly once, and fixing that afterwards means rewriting history. A prepare-commit-msg hook makes it automatic for anyone who runs 'git config core.hooksPath .githooks'. GPG signing was already active via global commit.gpgsign; this pins it locally so the repo does not depend on global state. Signed-off-by: Michael Harp <mike@mikeharp.com>
miharp
added a commit
that referenced
this pull request
Jul 23, 2026
OpenVox projects require DCO sign-off. Relying on remembering -s means it gets forgotten exactly once, and fixing that afterwards means rewriting history. A prepare-commit-msg hook makes it automatic for anyone who runs 'git config core.hooksPath .githooks'. GPG signing was already active via global commit.gpgsign; this pins it locally so the repo does not depend on global state. Signed-off-by: Michael Harp <mike@mikeharp.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes DCO sign-off automatic so it cannot be forgotten.
Finding: GPG signing was already working
I previously suggested neither signing nor sign-off was in place. That was half wrong —
commit.gpgsign=trueis set globally, so every commit in this repo has been GPG-signed all along, and GitHub reportsverified=true, reason=validfor all of them including the squash merge. The key is already registered on the account.The actual gap was only DCO sign-off.
The hook
.githooks/prepare-commit-msgappends aSigned-off-bytrailer when one is not already present. Enabled with:git config core.hooksPath .githooksRelying on remembering
-smeans it gets forgotten exactly once, and fixing that afterwards means rewriting history. The hook removes the failure mode. It usesgrep -Fso an email or name containing regex metacharacters cannot cause a false match, and it no-ops whenuser.name/user.emailare unset rather than writing a malformed trailer.Also pins
commit.gpgsignlocally so the repo does not silently depend on global config being right.Verification
This PR's own commit was produced with no
-sflag and came out both signed and signed-off:🤖 Generated with Claude Code