From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v1] scripts: make checkpatch cleaner for renamed files Date: Tue, 21 Feb 2017 03:24:04 -0800 (PST) Message-ID: <2496384.fbhMURyGl7@xps13> References: <1487563713-165778-1-git-send-email-david.hunt@intel.com> <20170220111632.GA144436@bricha3-MOBL3.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: Bruce Richardson , dev@dpdk.org To: David Hunt Return-path: Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) by dpdk.org (Postfix) with ESMTP id 0E5EB3238 for ; Tue, 21 Feb 2017 12:24:05 +0100 (CET) Received: by mail-wm0-f51.google.com with SMTP id v77so72819017wmv.0 for ; Tue, 21 Feb 2017 03:24:05 -0800 (PST) In-Reply-To: <20170220111632.GA144436@bricha3-MOBL3.ger.corp.intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "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 > > --- > > 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 () { # > > 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