blob: fba48e4904e06b3dcaeab0da3233ae2d60d5506d [file] [log] [blame]
pengzhao.liua923dea2023-06-25 09:58:20 +08001#!/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
10if git rev-parse --verify HEAD 2>/dev/null >/dev/null
11then
12 against=HEAD
13else
14 # Initial commit: diff against an empty tree object
15 against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
16fi
17
18git diff --cached --stat -p $against -- | ./scripts/checkpatch.pl --ignore GERRIT_CHANGE_ID,COMMIT_MESSAGE --strict --no-signoff -
19if [ $? -ne 0 ]
20then
21exit 1;
22fi
23
24git diff --name-status --cached $against -- | ./scripts/amlogic/licence_pre.pl -