All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] Misc: detect trailing space in the patches
@ 2012-12-05 23:38 ` nitin.a.kamble
  0 siblings, 0 replies; 7+ messages in thread
From: nitin.a.kamble @ 2012-12-05 23:37 UTC (permalink / raw)
  To: Openembedded-core

From: Nitin A Kamble <nitin.a.kamble@intel.com>

This commit is for detecting trailing white space in the create-pull-request script.

Thanks,
Nitin

The following changes since commit 381c4b69c7e8b452f4d3de2f8214e6e5f6a9abe7:

  sstate.bbclass: fix detection of owners matching sstate files (2012-12-05 15:34:07 +0000)

are available in the git repository at:
  git://git.pokylinux.org/poky-contrib nitin/misc
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=nitin/misc

Nitin A Kamble (1):
  create-pull-request: detect trailing white space

 scripts/create-pull-request |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

-- 
1.7.3.4




^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/1] create-pull-request: detect trailing white space
  2012-12-05 23:38 ` nitin.a.kamble
@ 2012-12-05 23:38   ` nitin.a.kamble
  -1 siblings, 0 replies; 7+ messages in thread
From: nitin.a.kamble @ 2012-12-05 23:37 UTC (permalink / raw)
  To: Openembedded-core

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(-)

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
+
+
-- 
1.7.3.4




^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 0/1] Misc: detect trailing space in the patches
@ 2012-12-05 23:38 ` nitin.a.kamble
  0 siblings, 0 replies; 7+ messages in thread
From: nitin.a.kamble @ 2012-12-05 23:38 UTC (permalink / raw)
  To: yocto

From: Nitin A Kamble <nitin.a.kamble@intel.com>

This commit is for detecting trailing white space in the create-pull-request script.

Thanks,
Nitin

The following changes since commit 381c4b69c7e8b452f4d3de2f8214e6e5f6a9abe7:

  sstate.bbclass: fix detection of owners matching sstate files (2012-12-05 15:34:07 +0000)

are available in the git repository at:
  git://git.pokylinux.org/poky-contrib nitin/misc
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=nitin/misc

Nitin A Kamble (1):
  create-pull-request: detect trailing white space

 scripts/create-pull-request |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

-- 
1.7.3.4



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/1] create-pull-request: detect trailing white space
@ 2012-12-05 23:38   ` nitin.a.kamble
  0 siblings, 0 replies; 7+ messages in thread
From: nitin.a.kamble @ 2012-12-05 23:38 UTC (permalink / raw)
  To: yocto

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(-)

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
+
+
-- 
1.7.3.4



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/1] Misc: detect trailing space in the patches
  2012-12-05 23:38 ` nitin.a.kamble
  (?)
  (?)
@ 2012-12-06  4:23 ` Martin Jansa
  2012-12-06  5:47   ` Daniel Stone
  -1 siblings, 1 reply; 7+ messages in thread
From: Martin Jansa @ 2012-12-06  4:23 UTC (permalink / raw)
  To: Nitin A Kamble; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 1079 bytes --]

Can you add also detection of mixed whitespace? E.g. tab followed by space
in multilinear indentation? Only as warning. Thanks
On Dec 6, 2012 12:38 AM, <nitin.a.kamble@intel.com> wrote:

> From: Nitin A Kamble <nitin.a.kamble@intel.com>
>
> This commit is for detecting trailing white space in the
> create-pull-request script.
>
> Thanks,
> Nitin
>
> The following changes since commit
> 381c4b69c7e8b452f4d3de2f8214e6e5f6a9abe7:
>
>   sstate.bbclass: fix detection of owners matching sstate files
> (2012-12-05 15:34:07 +0000)
>
> are available in the git repository at:
>   git://git.pokylinux.org/poky-contrib nitin/misc
>   http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=nitin/misc
>
> Nitin A Kamble (1):
>   create-pull-request: detect trailing white space
>
>  scripts/create-pull-request |   13 ++++++++++++-
>  1 files changed, 12 insertions(+), 1 deletions(-)
>
> --
> 1.7.3.4
>
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>

[-- Attachment #2: Type: text/html, Size: 1712 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/1] Misc: detect trailing space in the patches
  2012-12-06  4:23 ` [PATCH 0/1] Misc: detect trailing space in the patches Martin Jansa
@ 2012-12-06  5:47   ` Daniel Stone
  2012-12-06 18:44     ` Kamble, Nitin A
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Stone @ 2012-12-06  5:47 UTC (permalink / raw)
  To: Martin Jansa; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 609 bytes --]

Hi,

On 6 December 2012 15:23, Martin Jansa <martin.jansa@gmail.com> wrote:

> Can you add also detection of mixed whitespace? E.g. tab followed by space
> in multilinear indentation? Only as warning. Thanks
>

These checks can generate infuriating false positives when your patch
modifies upstream code which has trailing or mixed whitespace in either
context or removal lines; in this case, removing a line with trailing
whitespace and replacing it with one which doesn't would generate a
warning.  Mixed whitespace is also part of some coding styles, notably the
kernel's.

Cheers,
Daniel

[-- Attachment #2: Type: text/html, Size: 947 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/1] Misc: detect trailing space in the patches
  2012-12-06  5:47   ` Daniel Stone
@ 2012-12-06 18:44     ` Kamble, Nitin A
  0 siblings, 0 replies; 7+ messages in thread
From: Kamble, Nitin A @ 2012-12-06 18:44 UTC (permalink / raw)
  To: Daniel Stone, Martin Jansa; +Cc: yocto@yoctoproject.org

[-- Attachment #1: Type: text/plain, Size: 1183 bytes --]



From: Daniel Stone [mailto:daniel@fooishbar.org]
Sent: Wednesday, December 05, 2012 9:48 PM
To: Martin Jansa
Cc: Kamble, Nitin A; yocto@yoctoproject.org
Subject: Re: [yocto] [PATCH 0/1] Misc: detect trailing space in the patches

Hi,

On 6 December 2012 15:23, Martin Jansa <martin.jansa@gmail.com<mailto:martin.jansa@gmail.com>> wrote:

Can you add also detection of mixed whitespace? E.g. tab followed by space in multilinear indentation? Only as warning. Thanks

These checks can generate infuriating false positives when your patch modifies upstream code which has trailing or mixed whitespace in either context or removal lines; in this case, removing a line with trailing whitespace and replacing it with one which doesn't would generate a warning.  Mixed whitespace is also part of some coding styles, notably the kernel's.

Cheers,
Daniel

This code checks for the trialing whitespace only in the lines added by the patches. The context lines or removed lines are not checked. It is easy to check for mixed whitespace also, but before doing that I would like to know the final decision about it, as I see some objection to it too.

Thanks,
Nitin



[-- Attachment #2: Type: text/html, Size: 5386 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-12-06 18:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-05 23:37 [PATCH 0/1] Misc: detect trailing space in the patches nitin.a.kamble
2012-12-05 23:38 ` nitin.a.kamble
2012-12-05 23:37 ` [PATCH 1/1] create-pull-request: detect trailing white space nitin.a.kamble
2012-12-05 23:38   ` nitin.a.kamble
2012-12-06  4:23 ` [PATCH 0/1] Misc: detect trailing space in the patches Martin Jansa
2012-12-06  5:47   ` Daniel Stone
2012-12-06 18:44     ` Kamble, Nitin A

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.