gitconfig: Add lint-stable as pre-commit hook
authorPatrick Georgi <patrick@georgi-clan.de>
Sat, 25 Feb 2012 18:52:45 +0000 (19:52 +0100)
committerPatrick Georgi <patrick@georgi-clan.de>
Wed, 29 Feb 2012 23:04:40 +0000 (00:04 +0100)
When configuring the tree with "make gitconfig", a pre-commit hook
is installed that runs the stable lint tests.
If any of these fail, the log is visible (on stdout) and the
commit is aborted.

Change-Id: Ie2a26e87f466c63b24db8dca8827057a18ac7f3e
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/682
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Makefile.inc
util/gitconfig/pre-commit [new file with mode: 0755]

index 0f040e91b51f3bd1b87816c46075b074b1704856..2f61a45b812a6f7db3ef9d3af18170baf57221d3 100644 (file)
@@ -239,7 +239,7 @@ lint lint-stable:
        rm -f $$LINTLOG
 
 gitconfig:
-       if ! [ -x .git/hooks/commit-msg ]; then cp util/gitconfig/commit-msg .git/hooks/commit-msg; chmod +x .git/hooks/commit-msg; fi
+       for hook in commit-msg pre-commit; do if ! [ -x .git/hooks/$$hook ]; then cp util/gitconfig/$$hook .git/hooks/$$hook; chmod +x .git/hooks/$$hook; fi; done
        (git config --global user.name >/dev/null && git config --global user.email >/dev/null) || (printf 'Please configure your name and email in git:\n\n git config --global user.name "Your Name Comes Here"\n git config --global user.email your.email@example.com\n'; exit 1)
 
 crossgcc: clean-for-update
diff --git a/util/gitconfig/pre-commit b/util/gitconfig/pre-commit
new file mode 100755 (executable)
index 0000000..8ab3e56
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec make lint-stable