-
Notifications
You must be signed in to change notification settings - Fork 39
Introduce a Git hook to help ensure commits are signed-off #126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: release_1.4.0
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| #!/bin/sh | ||
|
|
||
| # Ensure the commit is signed-off by the author. | ||
| if ! grep -q '^Signed-off-by: ' "$1"; then | ||
| echo >&2 "Commit message must be signed off by the author." | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Catch duplicate Signed-off-by lines. | ||
| test "" = "$(grep '^Signed-off-by: ' "$1" | | ||
| sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { | ||
| echo >&2 Duplicate Signed-off-by lines. | ||
| exit 1 | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| #!/bin/bash -e | ||
| # | ||
| # Create our distribution zips. | ||
|
|
||
| # Create a link to our commit-msg hook. | ||
| ln -s -f ../../.githooks/commit-msg .git/hooks/commit-msg | ||
| echo "Installed commit-msg hook." |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,9 @@ | |
| "lock": false | ||
| }, | ||
| "scripts": { | ||
| "setup": [ | ||
| "./bin/install-git-hooks.sh" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| ], | ||
| "test": [ | ||
| "Composer\\Config::disableProcessTimeout", | ||
| "@php ./vendor/phpunit/phpunit/phpunit" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we rewrite this in NodeJS to remove the Bash dependency? All of the tooling already requires Node so that would work out of the box for everyone consistently.