Date: Wed, 20 Jan 2010 02:02:02 +0000
From: Ben Dooks
Linux Samsung SoC
Subject: git pre-commit hook running checkpatch.pl
I've written a git pre-commit hook which stops any commits happening if
checkpatch.pl reports problems with the patch. Any comments?
Q: What's a light-year?
A: One-third less calories than a regular year.
# pre-commit hook to run check-patch on the output and stop any commits
# that do not pass. Note, only for git-commit, and not for any of the
# other scenarios
# Copyright 2010 Ben Dooks,
if git rev-parse --verify HEAD 2>/dev/null >/dev/null
# Initial commit: diff against an empty tree object
git diff --cached $against -- | ./scripts/checkpatch.pl --no-signoff -