pengzhao.liu | a923dea | 2023-06-25 09:58:20 +0800 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # SPDX-License-Identifier: (GPL-2.0+ OR MIT) |
| 3 | # |
| 4 | # pre-commit hook to run check-patch on the output and stop any commits |
| 5 | # that do not pass. Note, only for git-commit, and not for any of the |
| 6 | # other scenarios |
| 7 | # |
| 8 | # Copyright 2010 Ben Dooks, <ben-linux@fluff.org> |
| 9 | |
| 10 | if git rev-parse --verify HEAD 2>/dev/null >/dev/null |
| 11 | then |
| 12 | against=HEAD |
| 13 | else |
| 14 | # Initial commit: diff against an empty tree object |
| 15 | against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 |
| 16 | fi |
| 17 | |
| 18 | git diff --cached --stat -p $against -- | ./scripts/checkpatch.pl --ignore GERRIT_CHANGE_ID,COMMIT_MESSAGE --strict --no-signoff - |
| 19 | if [ $? -ne 0 ] |
| 20 | then |
| 21 | exit 1; |
| 22 | fi |
| 23 | |
| 24 | git diff --name-status --cached $against -- | ./scripts/amlogic/licence_pre.pl - |