Re: rfc: treewide scripted patch mechanism? (was: Re: [PATCH] Makefile: Convert -Wimplicit-fallthrough=3 to just -Wimplicit-fallthrough for clang)QUILT
From: Stephen Rothwell
Date: Tue Aug 20 2019 - 20:33:57 EST
Hi Joe,
On Mon, 19 Aug 2019 17:08:00 -0700 Joe Perches <joe@xxxxxxxxxxx> wrote:
>
> A few examples:
>
> 1: a patch just to MAINTAINERS done via bash script:
>
> https://lore.kernel.org/lkml/904551f1f198ffac9a0f9c3c99aa966b0a7c76c1.camel@xxxxxxxxxxx/
>
> $ git grep -h "^[FX]:" MAINTAINERS | \
> cut -f2- | grep -vP '/$|\*|\?|\[' | \
> while read file ; do \
> if [ -d $file ]; then \
> sed -i -e "s@${file}\$@${file}/@" MAINTAINERS ; \
> fi ; \
> done
>
> This one is trivial and takes almost no time.
That one seems ok (except you need "s around the $file in [ -d $file ]).
In this case, I guess the plan is that I run the script and commit the
result using the commit message and authorship from the above mail ...
(I would also replace the first three commands with
sed -En 's/^[FX]:[[:space:]]*([^[*?]*[^[*?/])$/\1/p' MAINTAINERS
/me puts away his yak razor :-))
> 2: would be Julia Lawall's stracpy change done
> with coccinelle: (attached)
>
> This one takes quite a bit longer as it has to do a
> cocci --all-includes scan of each source file and each
> of its #include files.
What do I need to apply that "patch"?
--
Cheers,
Stephen Rothwell
Attachment:
pgp10QE8ceefy.pgp
Description: OpenPGP digital signature