| 1 | #!/bin/sh |
| 2 | # |
| 3 | # Copyright (C) - 2013 Christian Babeux <christian.babeux@efficios.com> |
| 4 | # |
| 5 | # This program is free software; you can redistribute it and/or modify it |
| 6 | # under the terms of the GNU General Public License, version 2 only, as |
| 7 | # published by the Free Software Foundation. |
| 8 | # |
| 9 | # This program is distributed in the hope that it will be useful, but WITHOUT |
| 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
| 12 | # more details. |
| 13 | # |
| 14 | # You should have received a copy of the GNU General Public License along with |
| 15 | # this program; if not, write to the Free Software Foundation, Inc., 51 |
| 16 | # Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 17 | |
| 18 | # To enable this hook, run the "install-checkpatch-hook" script. |
| 19 | |
| 20 | CHECKPATCH="extras/checkpatch.pl" |
| 21 | |
| 22 | if git rev-parse --verify HEAD >/dev/null 2>&1 |
| 23 | then |
| 24 | against=HEAD |
| 25 | else |
| 26 | # Initial commit: diff against an empty tree object |
| 27 | against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 |
| 28 | fi |
| 29 | |
| 30 | git diff --cached $against -- | $CHECKPATCH --no-signoff - |