[coreboot-gerrit] Change in coreboot[master]: util/gitconfig: improve robustness of checkpatch in pre-commit

Patrick Georgi (Code Review) gerrit at coreboot.org
Wed May 30 15:55:04 CEST 2018


Hello Martin Roth,

I'd like you to do a code review. Please visit

    https://review.coreboot.org/26694

to review the following change.


Change subject: util/gitconfig: improve robustness of checkpatch in pre-commit
......................................................................

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 <pgeorgi at chromium.org>
---
M util/gitconfig/pre-commit
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/94/26694/1

diff --git a/util/gitconfig/pre-commit b/util/gitconfig/pre-commit
index 0f13062..2aed957 100755
--- a/util/gitconfig/pre-commit
+++ b/util/gitconfig/pre-commit
@@ -20,7 +20,7 @@
 
 %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"

-- 
To view, visit https://review.coreboot.org/26694
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I099795119456a73c900b31ce191c2d9e898a5c7e
Gerrit-Change-Number: 26694
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Georgi <pgeorgi at google.com>
Gerrit-Reviewer: Martin Roth <martinroth at google.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180530/86e95097/attachment.html>


More information about the coreboot-gerrit mailing list