DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1] scripts: make checkpatch cleaner for renamed files
@ 2017-02-20  4:08 David Hunt
  2017-02-20 11:16 ` Bruce Richardson
  0 siblings, 1 reply; 3+ messages in thread
From: David Hunt @ 2017-02-20  4:08 UTC (permalink / raw)
  To: dev; +Cc: thomas.monjalon, David Hunt

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 <david.hunt@intel.com>
---
 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

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

* Re: [dpdk-dev] [PATCH v1] scripts: make checkpatch cleaner for renamed files
  2017-02-20  4:08 [dpdk-dev] [PATCH v1] scripts: make checkpatch cleaner for renamed files David Hunt
@ 2017-02-20 11:16 ` Bruce Richardson
  2017-02-21 11:24   ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Bruce Richardson @ 2017-02-20 11:16 UTC (permalink / raw)
  To: David Hunt; +Cc: dev, thomas.monjalon

On Mon, Feb 20, 2017 at 04:08:33AM +0000, David Hunt wrote:
> 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 <david.hunt@intel.com>
> ---
>  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)
> -- 

This seems a good idea. Renaming legacy files which aren't checkpatch
clean throws up lots of issues that we don't want to fix as part of the
rename.

Acked-by: Bruce Richardson <bruce.richardson@intel.com>

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

* Re: [dpdk-dev] [PATCH v1] scripts: make checkpatch cleaner for renamed files
  2017-02-20 11:16 ` Bruce Richardson
@ 2017-02-21 11:24   ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2017-02-21 11:24 UTC (permalink / raw)
  To: David Hunt; +Cc: Bruce Richardson, dev

2017-02-20 11:16, Bruce Richardson:
> On Mon, Feb 20, 2017 at 04:08:33AM +0000, David Hunt wrote:
> > 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 <david.hunt@intel.com>
> > ---
> >  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)
> 
> This seems a good idea. Renaming legacy files which aren't checkpatch
> clean throws up lots of issues that we don't want to fix as part of the
> rename.
> 
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Applied, thanks

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

end of thread, other threads:[~2017-02-21 11:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-20  4:08 [dpdk-dev] [PATCH v1] scripts: make checkpatch cleaner for renamed files David Hunt
2017-02-20 11:16 ` Bruce Richardson
2017-02-21 11:24   ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).