From 9110c1766866da698d20dc5d1e4ce87d098e2812 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Wed, 30 May 2018 15:48:16 +0200 Subject: util/gitconfig: improve robustness of checkpatch in pre-commit Users can have non-default configurations as to how git diff et al are presenting file names in diffs (default: a/ and b/ prefixes). checkpatch expects that and trims the first element, so enforce that configuration for the diff that's sent into it. Change-Id: I099795119456a73c900b31ce191c2d9e898a5c7e Signed-off-by: Patrick Georgi Reviewed-on: https://review.coreboot.org/26694 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber Reviewed-by: Martin Roth --- util/gitconfig/pre-commit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util/gitconfig') diff --git a/util/gitconfig/pre-commit b/util/gitconfig/pre-commit index 0f1306288e..2aed957df9 100755 --- a/util/gitconfig/pre-commit +++ b/util/gitconfig/pre-commit @@ -20,7 +20,7 @@ set -u # -o nounset %MAKE% lint-stable -PATCHDIFF=$(git diff --cached) +PATCHDIFF=$(git diff --cached --src-prefix=a/ --dst-prefix=b/) if printf "%s\n" "$PATCHDIFF" | grep -q "@@"; then echo echo "Running checkpatch" -- cgit v1.2.3