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

login
register
mail settings
Submitter Nitin A Kamble
Date Dec. 5, 2012, 11:37 p.m.
Message ID <07b0e677bac9a2fc73ff97b20d70849976f65345.1354750505.git.nitin.a.kamble@intel.com>
Download mbox | patch
Permalink /patch/40533/
State New
Headers show

Comments

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

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

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

Patch

diff --git a/scripts/create-pull-request b/scripts/create-pull-request
index 9a8913d..c35c427 100755
--- a/scripts/create-pull-request
+++ b/scripts/create-pull-request
@@ -173,7 +173,6 @@  mkdir $ODIR
 # Generate the patches and cover letter
 git format-patch -M40 --subject-prefix="$PREFIX" -n -o $ODIR --thread=shallow --cover-letter $RELATIVE_TO..$COMMIT_ID > /dev/null
 
-
 # Customize the cover letter
 CL="$ODIR/0000-cover-letter.patch"
 PM="$ODIR/pull-msg"
@@ -229,3 +228,15 @@  Review their content, especially the summary mail:
 When you are satisfied, you can send them with:
     send-pull-request -a -p $ODIR
 EOM
+
+# Check the patches for trailing white space
+echo 
+egrep -nH -e "^\+\s+$" $ODIR/* > /dev/null
+if [ $? -ne 1 ]; then
+	echo "WARNING: Trailing white space detected at these locations"
+	egrep -nH -e "^\+\s+$" $ODIR/* 
+else
+	echo "Note: No trailing white space is detected in these patches :)"
+fi
+
+