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

BUG: sendemail-validate hook is run too early

From
JNJani Nikula <jani.nikula@intel.com>
Date
Jan 2, 2020, 12:10 UTC
Message-ID
<875zhut5yd.fsf@intel.com>

I'm trying to use the sendemail-validate hook to validate the recipients of the patch email, among other things. Turns out the hook gets run immediately on the input patches, *not* on the "e-mail to be sent" as claimed by githooks(5).

This means the recipients added by git send-email automatically or on the git send-email command-line, or any changes done by the user with --annotate will not be validated.

This is easy to demonstrate in a git repo with e.g.

$ ln -s /bin/cat .git/hooks/sendemail-validate $ git send-email --dry-run -1 --to bypass-validation@example.com

The file passed to the validate hook does not have the address.

If changing the location of the current validation hook seems too risky, as apparently it's been like this for more than a decade, I suggest adding another hook on the actual email to be sent.

BR, Jani.

-- 
Jani Nikula, Intel Open Source Graphics Center
Next: Junio C Hamano
Message 1 of 4 in “BUG: sendemail-validate hook is run too early”
  1. Jani NikulaJan 2, 2020
  2. Junio C HamanoJan 2, 2020
  3. Jani NikulaJan 3, 2020
  4. Jani NikulaJan 3, 2020

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.