All of lore.kernel.org
 help / color / mirror / Atom feed
* BUG: sendemail-validate hook is run too early
@ 2020-01-02 12:10 Jani Nikula
  2020-01-02 20:26 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Jani Nikula @ 2020-01-02 12:10 UTC (permalink / raw)
  To: git


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-01-03 14:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-02 12:10 BUG: sendemail-validate hook is run too early Jani Nikula
2020-01-02 20:26 ` Junio C Hamano
2020-01-03  9:46   ` Jani Nikula
2020-01-03 14:02     ` Jani Nikula

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.