From ff22b6aca6daba2bf20b3eebd5299d03f906674c Mon Sep 17 00:00:00 2001 From: "Ronald G. Minnich" Date: Wed, 1 Aug 2018 07:19:31 -0700 Subject: make: add clang-format prepare-commit-msg hook To install this hook, run make install-git-commit-clangfmt This will install a pre-commit-msg hook that runs clang-format on all .c and .h files that are staged. It will add a clang-formatted-by: line to the commit message to indicate that clang-format was run on the files and that further processing of them is not needed. Change-Id: I1773f55b5b4677dad8f4bea017b6328fd93df20c Signed-off-by: Ronald G. Minnich Reviewed-on: https://review.coreboot.org/27779 Reviewed-by: Patrick Georgi Reviewed-by: Philipp Deppenwiese Tested-by: build bot (Jenkins) --- Makefile.inc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Makefile.inc') diff --git a/Makefile.inc b/Makefile.inc index fe325048f8..aa93222920 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -597,6 +597,9 @@ update: gitconfig: util/gitconfig/gitconfig.sh "$(MAKE)" +install-git-commit-clangfmt: + cp util/scripts/prepare-commit-msg.clang-format .git/hooks/prepare-commit-msg + include util/crossgcc/Makefile.inc .PHONY: tools -- cgit v1.2.3