From: Eric Wong <e@80x24.org>
To: Thorsten Leemhuis <linux@leemhuis.info>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
Jani Nikula <jani.nikula@intel.com>,
Junio C Hamano <gitster@pobox.com>,
workflows@vger.kernel.org, linux-kernel@vger.kernel.org,
Konstantin Ryabitsev <konstantin@linuxfoundation.org>,
Jonathan Corbet <corbet@lwn.net>,
git@vger.kernel.org, Linus Walleij <linus.walleij@linaro.org>,
Kees Cook <keescook@chromium.org>
Subject: Re: [RFC PATCH v1 1/1] docs: add the new commit-msg tags 'Reported:' and 'Reviewed:'
Date: Wed, 8 Dec 2021 17:02:26 +0000 [thread overview]
Message-ID: <20211208170226.GA12748@dcvr> (raw)
In-Reply-To: <af5ee2e8-cd59-fc9a-35fa-6fec1fc9aa33@leemhuis.info>
Thorsten Leemhuis <linux@leemhuis.info> wrote:
> On 30.11.21 09:24, Geert Uytterhoeven wrote:
> > On Mon, Nov 29, 2021 at 11:29 PM Eric Wong <e@80x24.org> wrote:
> >> It's a bit much for common cases with git-send-email and
> >> reasonable MUAs, I think. I don't know if formail is commonly
> >> installed, nowadays...
>
> Well, after your earlier suggestion I considered to go with this:
>
> - perl -pi -e 's|^Message-Id:\s*<?([^>]+)>?$|Link:
> https://lore.kernel.org/r/$1|g;' "$1"
> + perl -pi -e 's|^Message-ID:\s*<?([^>]+)>?$|Link:
> https://lore.kernel.org/r/$1|i;' "$1"
>
> But...
>
> > Of course ;-) You need it to run checkpatch on patch series obtained
> > through "b4 am", before you apply them to your tree:
> >
> > $ cat *mbx | formail -s scripts/checkpatch.pl
>
> ...this made me wonder if formail would be the better solution. I came
> up with this:
>
> formail -A "Link: https://lore.kernel.org/r/`formail -c -x Message-ID <
> "${1}" | sed 's!.*<\(.*\)>!\1!'`" < "${1}" | sponge "${1}"
>
> Downsides: instead of perl it requires sed and sponge (part of
> moreutils, which I guess not everyone has installed; but I tried to
> avoid a big here document or moving files around).
As Geert noted, formail is probably reasonable, but I certainly
don't have moreutils across all the systems I'm using right now.
> Is that worth it? Or is there a way to realize this in a more elegant
> fashion with tools everyone has installed?
*shrug* Since newlines after ':' are a concern and it's (probably :P)
safe to slurp entire contents of emails into memory nowadays;
some minor tweaks to the original perl invocation should work:
* use `$/ = undef' to force Perl to operate on the entire input at once
* use `m' RE modifier to ensure `^' and `$' still match SOL/EOL
($/ is only the input record separator, it doesn't change
Perl's definition of "lines" for `^' and `$')
perl -i -p -e 'BEGIN{$/=undef};s|^Message-ID:\s*<?([^>]+)>?$|Link:
https://lore.kernel.org/r/$1|im;'
next prev parent reply other threads:[~2021-12-08 17:02 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-22 7:33 [RFC PATCH v1 0/1] Create 'Reported:' and 'Reviewed:' tags for links in commit messages Thorsten Leemhuis
2021-11-22 7:33 ` [RFC PATCH v1 1/1] docs: add the new commit-msg tags 'Reported:' and 'Reviewed:' Thorsten Leemhuis
2021-11-22 16:29 ` Steven Rostedt
2021-11-22 18:50 ` Thorsten Leemhuis
2021-11-22 20:24 ` Steven Rostedt
2021-11-23 8:53 ` Thorsten Leemhuis
2021-11-23 18:52 ` Eric Wong
2021-11-24 1:37 ` Junio C Hamano
2021-11-24 6:12 ` Eric Wong
2021-11-26 12:49 ` Ævar Arnfjörð Bjarmason
2021-11-24 2:08 ` Ævar Arnfjörð Bjarmason
2021-11-26 7:29 ` Thorsten Leemhuis
2021-11-26 17:11 ` Eric Wong
2021-11-27 19:32 ` Thorsten Leemhuis
2021-11-27 19:52 ` Eric Wong
2021-11-27 20:20 ` Junio C Hamano
2021-11-29 12:03 ` Jani Nikula
2021-11-29 17:10 ` Steven Rostedt
2021-11-29 17:18 ` Junio C Hamano
2021-11-29 19:18 ` Jani Nikula
2021-11-29 17:26 ` Eric Wong
2021-11-29 19:20 ` Jani Nikula
2021-11-30 8:24 ` Geert Uytterhoeven
2021-12-08 13:41 ` Thorsten Leemhuis
2021-12-08 17:02 ` Eric Wong [this message]
2021-11-29 22:16 ` Jonathan Corbet
2021-11-30 13:10 ` Thorsten Leemhuis
2021-12-01 12:24 ` Geert Uytterhoeven
2021-11-22 15:12 ` [RFC PATCH v1 0/1] Create 'Reported:' and 'Reviewed:' tags for links in commit messages Konstantin Ryabitsev
2021-11-22 17:04 ` Steven Rostedt
2021-11-22 18:40 ` Thorsten Leemhuis
2021-11-22 18:48 ` Steven Rostedt
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=20211208170226.GA12748@dcvr \
--to=e@80x24.org \
--cc=corbet@lwn.net \
--cc=geert@linux-m68k.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jani.nikula@intel.com \
--cc=keescook@chromium.org \
--cc=konstantin@linuxfoundation.org \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@leemhuis.info \
--cc=workflows@vger.kernel.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).