All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: git@vger.kernel.org
Subject: BUG: sendemail-validate hook is run too early
Date: Thu, 02 Jan 2020 14:10:02 +0200	[thread overview]
Message-ID: <875zhut5yd.fsf@intel.com> (raw)


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

             reply	other threads:[~2020-01-02 12:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-02 12:10 Jani Nikula [this message]
2020-01-02 20:26 ` BUG: sendemail-validate hook is run too early Junio C Hamano
2020-01-03  9:46   ` Jani Nikula
2020-01-03 14:02     ` Jani Nikula

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=875zhut5yd.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=git@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 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.