Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1174717pxb; Fri, 26 Feb 2021 04:35:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJzgKXcpw0X54JK3z8qtZ++6Og8qJ0E3mKIvBFqGpcbSUdhjdP0GJG+8fBphWvEPFWR2E/ly X-Received: by 2002:a17:906:c1cf:: with SMTP id bw15mr3257643ejb.82.1614342903309; Fri, 26 Feb 2021 04:35:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614342903; cv=none; d=google.com; s=arc-20160816; b=nGAqzm0ct8/EcuVoYDcd5nCA5nag8aymd8K11/wMKGCW2xAuImKz/SkZbtupQs8F5L ohJRO8pZIqhQ9rqNqopztCar5D08f1nXuWcaYnpno1mVbVNKVeftOwaA3cLx27aSrMeh U+lpuVaL21/SvfxSDT2EgZx9PNZKDrmR67NVzooeKOH1PkETQyoFYvQnFCu2bhfRR1L9 BCaziEGBrXGZPdKQDilgBrfzMJ2SPh2NHPJjps8H1seTN0hfFPnq/DQ7DlPe+ZbFku9Y bgcXV2AhTutbuai/JGTnzdNI6nAv+Vi+wDCWVs6m2N9RBqHT0AjAoPcLAUwDfWKnUGyS KBWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:user-agent:date:message-id:subject:from:cc:to :dkim-signature; bh=GCu0hDorWnnS7HlnLgsgdPKlD9qx5NPHhv/TQ0Dvwf8=; b=Fx1UhUIM8JdlaXMDmM3Y1Ua1RyLoqjNFU4dLdw/jZXtVNzDGumcR3JidRjmXBqmB51 5Plhgu/aXUMLtFTf54Lm2Huc0gvLr/87dm5qsklp9t3empRGBBs8r4b+vJIy0O5zZ183 5fIT44AXl/D+lichCFLpDvawQq4QsdOz3WTLE7kmt5piYvnIpwyq4nt4Nhs3IgLMQAWl /RpaTOG4sRcyCNMXPAIC5CrxwvBgMf5K3ym3g2rNg/8klpJpJ0/evKelzxrr9QQkGBkA bPkq1KcfBTba1tpxYue9YCJflvVmGIvvCSe+KK/NCx3T3ICjndoTYlg5VJ7Uck54WrE1 ye6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=LkYTlqy1; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u18si5496710ejb.504.2021.02.26.04.34.40; Fri, 26 Feb 2021 04:35:03 -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=@rasmusvillemoes.dk header.s=google header.b=LkYTlqy1; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230071AbhBZMct (ORCPT + 99 others); Fri, 26 Feb 2021 07:32:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229999AbhBZMcs (ORCPT ); Fri, 26 Feb 2021 07:32:48 -0500 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53918C06174A for ; Fri, 26 Feb 2021 04:32:08 -0800 (PST) Received: by mail-ed1-x530.google.com with SMTP id d13so5720861edp.4 for ; Fri, 26 Feb 2021 04:32:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=GCu0hDorWnnS7HlnLgsgdPKlD9qx5NPHhv/TQ0Dvwf8=; b=LkYTlqy1E04E6yiFg3imxnxZl2eDuE7gimiCB3O0aoMKlQR46zABeAoPNsIJOstndX HJ9ZIhfs6fcT5fAmmoNk+6iacNnwXwevZjjZN4wp8jAxX46y4pGa6CxQ7vyzb181d1+x fdIm6IJcGkgfNPo9CKkHxvolxBhLrFXqSfT4A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=GCu0hDorWnnS7HlnLgsgdPKlD9qx5NPHhv/TQ0Dvwf8=; b=hJzCzu8vVNHYOxSuDLyBsE9EVcsmIomSgwa4TE7rkZzQhDmcVJUU6DDD1whR5hAKN8 mLRN8y5uDKWXV0faNfbf3lX1HtGRgDvLtsvclzGDuPvJurvhAzekcxDJ/ej62pkz9SGd l/RDGJPCQ7EwasUa/6tOg/JYaVwp6wiXPLvhcnC4CufgqHxU55G1QX9gr4gise/UQVX1 /FI1+z4ZWv4C8wCEAJIJwhGESq930FRLADxGRWVbg/dJhIuXQD18X7AJRQ9n2lJnzTK0 yJMTcbJI+dvhrqpUT75WnTMJ/bFWq33MtU4m9cOLIDbHaCEj/QgTbjmEVw4QJIpots+n AvqA== X-Gm-Message-State: AOAM533lgFtnCwZJ/W2EuBBJUyf7HiWydwlGlx3QqLLk4+wHBPz+6eU5 3uEW+E9Q3JJ76qN7qET37HfgnQ== X-Received: by 2002:a05:6402:17b6:: with SMTP id j22mr2920170edy.325.1614342726056; Fri, 26 Feb 2021 04:32:06 -0800 (PST) Received: from [192.168.1.149] ([80.208.71.141]) by smtp.gmail.com with ESMTPSA id v11sm5005116eds.14.2021.02.26.04.32.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 26 Feb 2021 04:32:05 -0800 (PST) To: Greg Kroah-Hartman Cc: Linus Torvalds , LKML , Thomas Gleixner From: Rasmus Villemoes Subject: spdx spring cleaning Message-ID: <84ce357f-3400-2a4d-02e9-01e659829560@rasmusvillemoes.dk> Date: Fri, 26 Feb 2021 13:32:04 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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|'