git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC PATCH v1 1/1] docs: add the new commit-msg tags 'Reported:' and 'Reviewed:'

From
EWEric Wong <e@80x24.org>
Date
Dec 8, 2021, 17:02 UTC
Message-ID
<20211208170226.GA12748@dcvr>
In-Reply-To
<af5ee2e8-cd59-fc9a-35fa-6fec1fc9aa33@leemhuis.info>
Thorsten Leemhuis <linux@leemhuis.info> wrote:
Show 29 quoted lines
> 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;'
Previous: Thorsten LeemhuisNext: Steven Rostedt
Message 18 of 19 in “Re: [RFC PATCH v1 1/1] docs: add the new commit-msg tags 'Reported:' and 'Reviewed:'”
  1. Eric WongNov 23, 2021
  2. Junio C HamanoNov 24, 2021
  3. Eric WongNov 24, 2021
  4. Ævar Arnfjörð BjarmasonNov 26, 2021
  5. Ævar Arnfjörð BjarmasonNov 24, 2021
  6. Thorsten LeemhuisNov 26, 2021
  7. Eric WongNov 26, 2021
  8. Thorsten LeemhuisNov 27, 2021
  9. Eric WongNov 27, 2021
  10. Junio C HamanoNov 27, 2021
  11. Jani NikulaNov 29, 2021
  12. Junio C HamanoNov 29, 2021
  13. Jani NikulaNov 29, 2021
  14. Eric WongNov 29, 2021
  15. Jani NikulaNov 29, 2021
  16. Geert UytterhoevenNov 30, 2021
  17. Thorsten LeemhuisDec 8, 2021
  18. Eric WongDec 8, 2021
  19. Steven RostedtNov 29, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.