Thread (3 messages) 3 messages, 3 authors, 2017-02-21
STALE3438d

[PATCH v1] scripts: make checkpatch cleaner for renamed files

From: David Hunt <hidden>
Date: 2017-02-20 11:08:17
Subsystem: the rest · Maintainer: Linus Torvalds

When a file is renamed, a normal diff will include all the code of
the renamed file, and checkpatch will find warnings and errors,
even though it's just a rename.

This change will result in a 'rename' line in the diff, resulting
in a much cleaner checkpatches result.

Signed-off-by: David Hunt <redacted>
---
 devtools/checkpatches.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
index cfe262b..6fbfb50 100755
--- a/devtools/checkpatches.sh
+++ b/devtools/checkpatches.sh
@@ -89,7 +89,8 @@ check () { # <patch> <commit> <title>
 	if [ -n "$1" ] ; then
 		report=$($DPDK_CHECKPATCH_PATH $options "$1" 2>/dev/null)
 	elif [ -n "$2" ] ; then
-		report=$(git format-patch --no-stat --stdout -1 $commit |
+		report=$(git format-patch --find-renames \
+			--no-stat --stdout -1 $commit |
 			$DPDK_CHECKPATCH_PATH $options - 2>/dev/null)
 	else
 		report=$($DPDK_CHECKPATCH_PATH $options - 2>/dev/null)
-- 
2.7.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help