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

[PATCH 0/2] Expose header information to git-send-email's sendemail-validate hook

From
SMStrawbridge, Michael <michael.strawbridge@amd.com>
Date
Nov 11, 2022, 02:15 UTC
Message-ID
<20221111021502.449662-1-michael.strawbridge@amd.com>
Sure.  Thank you for the quick feedback.  Let me see if I can explain the idea.
Sometimes it can be helpful to react to special keywords in a git send-email subject line or specific email address.  Like perhaps one wants to do some kind of sorting of patches by mailing list or "to" email address.  You could use the sendemail-validate hook as a way to copy the patch to a specific location locally based on who you are emailing.  I'm sure there could be other uses for the smtp header information as well.  Presumably the header information is printed to stdout before sending an email, for other reasons too (this happens already).  My patch makes it possible to now automate any checks one might be doing manually with these headers.
With some testing I can confirm that encoded headers (like a utf8 string) get passed in encoded form.  The random example I tried was with the subject "Rhyddhewch y racŵn" and it is showns as "Subject: [PATCH] =?UTF-8?q?Rhyddhewch=20y=20rac=C5=B5n?=".  However, the original print of the smtp headers doesn't handle encoded text either, so it is no worse than current.
Lastly, with the validate code moving later there are some changes in output.  After my change, the user will get asked about: composed email (compose argument code), 8 bit encoding, who to send to, and which message-ID to reply to before validation.  Since these change the header information, validation needs to happen after.

Michael PS- I fixed the Signed-off-by as well.

Michael Strawbridge (2):
  Expose header information to git-send-email's sendemail-validate hook
  Update sendemail-validate hook docs to add header file parameter
 Documentation/githooks.txt |  8 +++---
 git-send-email.perl        | 57 +++++++++++++++++++++++++-------------
 2 files changed, 41 insertions(+), 24 deletions(-)
Cc: Luben Tuikov <luben.tuikov@amd.com>
Cc: brian m. carlson <sandals@crustytoothpaste.net>
-- 
2.34.1
Next: Strawbridge, Michael
Message 1 of 5 in “Expose header information to git-send-email's sendemail-validate hook”
  1. 0/2 Expose header information to git-send-email's sendemail-validate hookStrawbridge, Michael, Nov 11, 2022
  2. 1/2 Expose header information to git-send-email's sendemail-validate hookStrawbridge, Michael, Nov 11, 2022
  3. 2/2 Update sendemail-validate hook docs to add header file parameterStrawbridge, Michael, Nov 11, 2022
  4. Ævar Arnfjörð BjarmasonNov 11, 2022
  5. Luben TuikovNov 11, 2022

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.