Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1189459pxb; Fri, 26 Feb 2021 05:01:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJytxV/N2+b48hI3Sf3wOHiHgITPicahwfMG+e5ZwYDVE1D7sMIuGlbBqA3vDlsIBdB2CNP2 X-Received: by 2002:a17:906:296a:: with SMTP id x10mr3220839ejd.240.1614344475296; Fri, 26 Feb 2021 05:01:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614344475; cv=none; d=google.com; s=arc-20160816; b=07ba75bTDSDj3L+BYRoC2XVFX7pqZXAu/ApygM/u20DFKEROgNlFULKYQXzon37pIu njciLDcj2pqumpUMqF03h8yzZ+evKT7flNt4bNV4tP1yFvftzdckA4oifUMzdCIBs3td T6q2QHjhsi2QjlwrXt5jGwI9JZWgXqxtFA2NbFXjoRfqyxl4P47y0UXhtVGXqv51fNZA Uv8yjxCjDrgUzi9x6oRAxFqkx/1wNwrrXaREtBNTA3EgCgdNmC/HkntXOXKUL5XLpuNC ZI7Q/zrEC3nKFxe76PQFhVTjGWZ5KFsE8CO13IfOG2Cn2D/9TvxoUay9zt7f4aYC60ES 7SsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=I6vkx48zGIGCqmnfv2aB02NmG1rMfK/Xrak3z9asBA8=; b=EKFefVRNqPOYwC/mlDWNJefxsZLi3B/Xj74fialEwGYiPv58KS84owxgict0jhlbME MVkFXIBt4OZe4A50dWOENffj/wHg51mpB4C7Np31ggGNU7+0AWVGMPXdbREpURKpBxFD wY8x+L7vAc0UDxl1+q/d/jeyrRr+TEjSUK8eWm/nAkuX8MFFQUl7egKVE//f0Sq0g+LP ZYikdK9suTRk6x00IF4RHD5+zyec+Bh98sM0b4OiHwDIL4zzDj52QZIqSI06WPuC6KI/ WCcfB88sAbUTKfIIDHNkfRbBflIP9roZOUUgEhYVHUXDF3yHliMk7b5L5sKReDOmPqW4 OqPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oyPcylKb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m19si6121873edd.509.2021.02.26.05.00.50; Fri, 26 Feb 2021 05:01:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oyPcylKb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230014AbhBZM72 (ORCPT + 99 others); Fri, 26 Feb 2021 07:59:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:43758 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229953AbhBZM71 (ORCPT ); Fri, 26 Feb 2021 07:59:27 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 68D3064E4D; Fri, 26 Feb 2021 12:58:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614344327; bh=weGnsnGiPqwfLIzMuRDLHgkEs6U6s1bW/ulqMKWlGeI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oyPcylKbJQ5rjgQpUE8mJtVcMvSJJcjYLp3k7oTJ1fLDuShfjQ8QZ73omWHS19Ael m9RS1vpcqs0fUs3z/WVjQVy2rCMIdSfumu/bQGDjgpVfQxBUZZ87MNHSAKpZBSaPtV zi6wXcVD/IIJ562im6ugrn3fFVBX1dyze+h9Amyk= Date: Fri, 26 Feb 2021 13:58:44 +0100 From: Greg Kroah-Hartman To: Rasmus Villemoes Cc: Linus Torvalds , LKML , Thomas Gleixner Subject: Re: spdx spring cleaning Message-ID: References: <84ce357f-3400-2a4d-02e9-01e659829560@rasmusvillemoes.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <84ce357f-3400-2a4d-02e9-01e659829560@rasmusvillemoes.dk> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 26, 2021 at 01:32:04PM +0100, Rasmus Villemoes wrote: > Hi, > > I was doing some 'git grep SPDX-License-Identifier' statistics, but > noticed that I had to do a lot more normalization than expected (clearly > handling different comment markers is needed). > > How about running something like the below after -rc1? The end result is > > 2558 files changed, 2558 insertions(+), 2558 deletions(-) > > mostly from the last fixup, before that it's merely > > 90 files changed, 90 insertions(+), 90 deletions(-) > > Rasmus > > #!/bin/sh > > fixup() { > gp="$1" > cmd="$2" > > git grep --files-with-matches "SPDX-License-Identifier:$gp" | grep > -v COPYING | \ > xargs -r -P8 sed -E -s -i -e "1,3 { /SPDX-License-Identifier/ { > $cmd } }" > git diff --stat | tail -n1 > } > > # tab->space, the first string is "dot asterisk tab" > fixup '.* ' 's/\t/ /g' > > # trailing space > fixup '.* $' 's/ *$//' > > # collapse multiple spaces > fixup '.* ' 's/ */ /g' > > # or -> OR > fixup '.* or ' 's/ or / OR /g' > > # Remove outer parenthesis - when that pair is the only set of > # parenthesis. Only none or */ trailing comment marker is handled. > fixup ' (' 's|Identifier: \(([^()]*)\)( \*/)?$|Identifier: \1\2|' What exactly are you trying to "clean up" here? What tool are you using that can not properly parse the tags that we currently have? confused, greg k-h