mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: spdx spring cleaning
Date: Fri, 26 Feb 2021 13:58:44 +0100	[thread overview]
Message-ID: <YDjwhAIMvCWAPSUY@kroah.com> (raw)
In-Reply-To: <84ce357f-3400-2a4d-02e9-01e659829560@rasmusvillemoes.dk>

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

  reply	other threads:[~2021-02-26 12:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-26 12:32 Rasmus Villemoes
2021-02-26 12:58 ` Greg Kroah-Hartman [this message]
2021-02-26 13:33   ` Rasmus Villemoes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YDjwhAIMvCWAPSUY@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®