[v2,1/1] create-pull-request: detect trailing white space

Submitted by Nitin A Kamble on Dec. 11, 2012, 5:28 p.m. | Patch ID: 40769


Message ID c821b739192090a224f7293426f1fe3eb063834d.1355246231.git.nitin.a.kamble@intel.com
State Accepted
Commit 8251685031d4b268e653c71e956d63907fed8d31
Headers show

Commit Message

Nitin A Kamble Dec. 11, 2012, 5:28 p.m.
From: Nitin A Kamble <nitin.a.kamble@intel.com>

Add logic in the create-pull-request to detect and warn about the
trailing white space inserted by patches.

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
 scripts/create-pull-request |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

Patch hide | download patch | download mbox

diff --git a/scripts/create-pull-request b/scripts/create-pull-request
index 9a8913d..9692bf1 100755
--- a/scripts/create-pull-request
+++ b/scripts/create-pull-request
@@ -229,3 +229,11 @@  Review their content, especially the summary mail:
 When you are satisfied, you can send them with:
     send-pull-request -a -p $ODIR
+# Check the patches for trailing white space
+egrep -q -e "^\+.*\s+$" $ODIR/*
+if [ $? -ne 1 ]; then
+	echo
+	echo "WARNING: Trailing white space detected at these locations"
+	egrep -nH --color -e "^\+.*\s+$" $ODIR/*