From: Luben Tuikov <luben.tuikov@amd.com>
To: "Strawbridge, Michael" <Michael.Strawbridge@amd.com>,
"git@vger.kernel.org" <git@vger.kernel.org>
Cc: Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH v6 2/2] send-email: expose header information to git-send-email's sendemail-validate hook
Date: Mon, 16 Jan 2023 23:35:37 -0500 [thread overview]
Message-ID: <fe862ffd-aec4-932a-73e6-e7ddb0b97ded@amd.com> (raw)
In-Reply-To: <20230117013932.47570-3-michael.strawbridge@amd.com>
Hi Michael,
Good work on this. I've a few tiny notes following.
On 2023-01-16 20:39, Strawbridge, Michael wrote:
> To allow further flexibility in the git hook, the SMTP header
"git" is something different. You want to use the capitalization "Git".
> information of the email that git-send-email intends to send, is now
"that" --> "which".
> passed as a 2nd argument to the sendemail-validate hook.
"a 2nd argument" --> "the 2nd argument".
> As an example, this can be useful for acting upon keywords in the
> subject or specific email addresses.
>
> Cc: Luben Tuikov <luben.tuikov@amd.com>
> Cc: Junio C Hamano <gitster@pobox.com>
> Signed-off-by: Michael Strawbridge <michael.strawbridge@amd.com>
> ---
> Documentation/githooks.txt | 29 +++++++++++++++++++----
> git-send-email.perl | 31 +++++++++++++++++--------
> t/t9001-send-email.sh | 47 ++++++++++++++++++++++++++++++++++++--
> 3 files changed, 91 insertions(+), 16 deletions(-)
>
> diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt
> index a16e62bc8c..e80f481efd 100644
> --- a/Documentation/githooks.txt
> +++ b/Documentation/githooks.txt
> @@ -583,10 +583,31 @@ processed by rebase.
> sendemail-validate
> ~~~~~~~~~~~~~~~~~~
>
> -This hook is invoked by linkgit:git-send-email[1]. It takes a single parameter,
> -the name of the file that holds the e-mail to be sent. Exiting with a
> -non-zero status causes `git send-email` to abort before sending any
> -e-mails.
> +This hook is invoked by linkgit:git-send-email[1].
> +
> +It takes these command line arguments:
"It takes two command line arguments. They are,"
> +1. the name of the file that holds the e-mail to be sent.
"which holds the contents of the email to be sent."
Sentence ends and the next one should be capitalized.
> +2. the name of the file that holds the SMTP headers to be used.
"The name of the file which holds the SMTP envelope and headers of the email."
> +
> +The SMTP headers will be passed to the hook in the below format.
> +Take notice of the capitalization and multi-line tab structure.
Always use present simple tense when describing mechanics of code,
not future tense, "are passed". Think of when the user is reading
this long after the patch went in.
Also, please use "the format below."
> + From: Example <from@example.com>
> + To: to@example.com
> + Cc: cc@example.com,
> + A <author@example.com>,
> + One <one@example.com>,
> + two@example.com
> + Subject: PATCH-STRING
> + Date: DATE-STRING
> + Message-Id: MESSAGE-ID-STRING
> + X-Mailer: X-MAILER-STRING
> + Reply-To: Reply <reply@example.com>
> + MIME-Version: 1.0
> + Content-Transfer-Encoding: quoted-printable
Perhaps this is too much detail and unnecessary for the generalization
we're trying to achieve here?
Maybe the following would suffice?
The SMTP envelope and headers are passed as the 2nd argument to the
hook, exactly as they are passed to the user's Mail Transport Agent (MTA).
In effect, the email given to the user's MTA, is the contents of $2 followed
by the contents of $1.
--
Regards,
Luben
next prev parent reply other threads:[~2023-01-17 4:36 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-17 1:39 [PATCH v6 0/2] send-email: expose header information to git-send-email's sendemail-validate hook Strawbridge, Michael
2023-01-17 1:39 ` [PATCH v6 1/2] send-email: refactor header generation functions Strawbridge, Michael
2023-01-17 3:38 ` Luben Tuikov
2023-01-17 4:13 ` Luben Tuikov
2023-01-17 1:39 ` [PATCH v6 2/2] send-email: expose header information to git-send-email's sendemail-validate hook Strawbridge, Michael
2023-01-17 4:35 ` Luben Tuikov [this message]
2023-01-17 5:06 ` Luben Tuikov
2023-01-17 7:31 ` Junio C Hamano
2023-01-18 8:31 ` Luben Tuikov
2023-01-18 16:27 ` Junio C Hamano
2023-01-18 16:35 ` Luben Tuikov
2023-01-18 20:44 ` Michael Strawbridge
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=fe862ffd-aec4-932a-73e6-e7ddb0b97ded@amd.com \
--to=luben.tuikov@amd.com \
--cc=Michael.Strawbridge@amd.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).