Commit a27351b
committed
chore(hooks): add commit-msg hook to enforce Signed-off-by line in commit messages
Although our documentation instructs users to configure their .gitconfig
with `gpgsign = true` under the [commit] section, we cannot rely solely
on this setting. Users may misconfigure their environment, and
third-party contributors might not follow these instructions.
This commit introduces a commit-msg hook that checks for the presence of
a `Signed-off-by:` line in the commit message. The hook does not verify
the actual presence of a cryptographic signature. It only checks for the
text. We assume the line is auto-generated by git when using the `-s`
flag. A malicious user could bypass this check by manually adding the
line, but our goal is to encourage best practices, not to enforce
cryptographic validation.
Signed-off-by: Gil Levkovich <[email protected]>1 parent 8b1a2fe commit a27351b
File tree
3 files changed
+29
-1
lines changed- contrib/scripts
3 files changed
+29
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
17 | 22 | | |
18 | 23 | | |
19 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
0 commit comments