Skip to content

Conversation

@philipjohn
Copy link
Contributor

Adds a commit-msg hook that checks for the presence of the "Signed-off-by: " string in the commit message and rejects the commit when it's missing. Additonally, it checks if there is more than one "Signed-off-by: " string and rejects that too (this is from the default hook sample).

To make life easier for contributors a composer script is added so that running composer run setup runs a simple bash script (bin/install-git-hooks.sh) which adds a symlink from the committed git hook to .git/hooks/commit-msg.

Finally, the docs are updated to let people know they can install the git hook. I opted to leave the manual instructions for signing commits in place, as it's helpful for understanding as well.

@rmccue
Copy link
Member

rmccue commented Jun 24, 2025

I'm generally against bundling this into the repo (eg with things like Husky), but I think a manual command is an acceptable tradeoff. (Note though, this requirement is true for all repositories on this organisation, and indeed as a general rule across LF projects.)

Should we add a prepare-commit-msg hook as well? Git does intentionally not have a config flag for this as "Adding the Signed-off-by trailer to a patch should be a conscious act and means that you certify you have the rights to submit this work under the same open source license.", but I know a lot of people are using it.

@Ipstenu
Copy link
Contributor

Ipstenu commented Oct 27, 2025

I think having this as a check will help make sure people actually do the thing before we get to the part where we have to tell them "You need to rebase the PR so we can accept it."

Better link for Ryan's link - https://stackoverflow.com/a/46536244

@philipjohn Any thoughts?

@Ipstenu Ipstenu added enhancement New feature or request needs review Probably ready for work, but needs eyes to double check. labels Oct 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request needs review Probably ready for work, but needs eyes to double check.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants