From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH 01/19] devtools: add simple script to find duplicate includes Date: Thu, 13 Jul 2017 14:36:46 +0200 Message-ID: <1928687.rzFJKnVBFz@xps> References: <20170711185546.26138-1-stephen@networkplumber.org> <7177425.p9cP4Rfg1a@xps> <97A8C4B8-3AC2-47D1-AC31-C75D6E23D7AE@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Cc: Stephen Hemminger , dev@dpdk.org To: "Wiles, Keith" Return-path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id AB1C229CB for ; Thu, 13 Jul 2017 14:36:47 +0200 (CEST) In-Reply-To: <97A8C4B8-3AC2-47D1-AC31-C75D6E23D7AE@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" 13/07/2017 14:19, Wiles, Keith: >=20 > > On Jul 13, 2017, at 1:56 AM, Thomas Monjalon wrot= e: > >=20 > > 12/07/2017 23:59, Stephen Hemminger: > >> On Tue, 11 Jul 2017 22:33:55 +0200 > >> Thomas Monjalon wrote: > >>=20 > >>> Thank you for this script, but... it is written in Perl! > >>> I don't think it is a good idea to add yet another language to DPDK. > >>> We already have shell and python scripts. > >>> And I am not sure a lot of (young) people are able to parse it ;) > >>>=20 > >>> I would like to propose this shell script: > >>>=20 > >>> dirs=3D'app buildtools drivers examples lib test' > >>> pattern=3D'^[[:space:]]*#include[[:space:]]*[<"](.*)[>"].*' > >>>=20 > >>> for file in $(git ls $dirs) ; do > >>> dups=3D$(sed -rn "s,$pattern,\1,p" $file | sort | uniq -d) > >>> [ -n "$dups" ] || continue > >>> echo "$file" > >>> echo "$dups" | sed 's,^,\t,' > >>> done > >>=20 > >> There is no "git ls" command in current version,=20 > >>=20 > >> Using find instead works. > >=20 > > Yes, both work if specifying source code directories as above. >=20 > =E2=80=98git ls=E2=80=99 I had to change it to =E2=80=98git ls-files=E2= =80=99 to make it work. I think you have a git alias setup for ls-files. Ah yes, you're right! Thanks, I has not well understood the original comment :) > Can this be added to the patch testing? Yes sure, I will do.