All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 2/2] send-email: add --header-cmd option
Date: Tue, 25 Apr 2023 14:53:59 -0400	[thread overview]
Message-ID: <87leifpzco.fsf@gmail.com> (raw)
In-Reply-To: <xmqqcz3s3oz7.fsf@gitster.g> (Junio C. Hamano's message of "Tue, 25 Apr 2023 09:29:00 -0700")

Hi Junio,

Junio C Hamano <gitster@pobox.com> writes:

> Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:
>
>> I'm not too familiar with the email format; but I presume an empty line
>> would signal the end of a message?  That'd be bad yes, but I think it
>> cannot currently happen given the 'last if $line =~ /^$/;' guard at in
>> execute_cmd around line 2023; it'd means headers following an empty line
>> would be discarded though.  The expected use case is indeed for a user's
>> script to produce RFC 2822 style headers to messages.
>
> Yes, silently discarding the end-user input is what I meant by a
> disaster.

In v3 just sent, empty blank lines are now detected and reported as an
error.

>> The former (a true default with no way to turn it off other than
>> redefining it), which I believe is the same behavior as for --cc-cmd or
>> --to-cmd.  There are no '--no-cc-cmd' or '--no-to-cmd' options, although
>> their result can be filtered via the '--no-cc' and '--no-to' options.
>
> Yup.
>
>> Looking in the source, options supporting '--no-' always appear to be
>> boolean toggles (on/off) though, so I'm not sure how a '--no-header-cmd'
>> that take a value can currently be implemented.  Perhaps it could be
>> added later if there is a need?
>
> Perhaps we can do without a configuration variable first, and
> perhaps the variable could be added later if there is a need and a
> proper way to turn it off per invocation basis.

I'd like to preserve the sendemail.headerCmd configuration variable; as
it properly enables the use case that motivated this change :-).  If it
means I need to add some ad-hoc --no-header-cmd, I can do so; let me
know!

>> I've extracted such postprocessing into fold_headers and applied
>> execute_cmd to it in new invoke_header_cmd subroutine.
>
> Sounds like a good approach (without looking the actual patch).

OK.  Make sure to look at the latest revision, v3.

Thanks again!

-- 
Maxim

  parent reply	other threads:[~2023-04-25 18:55 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-23 12:27 [PATCH 0/2] send-email: add --header-cmd option Maxim Cournoyer
2023-04-23 12:27 ` [PATCH 1/2] send-email: extract execute_cmd from recipients_cmd Maxim Cournoyer
2023-04-24 21:46   ` Junio C Hamano
2023-04-25  1:55     ` Maxim Cournoyer
2023-04-23 12:27 ` [PATCH 2/2] send-email: add --header-cmd option Maxim Cournoyer
2023-04-24 22:09   ` Junio C Hamano
2023-04-25 16:22     ` Maxim Cournoyer
2023-04-25 16:29       ` Junio C Hamano
2023-04-25 18:50         ` [PATCH v3 0/3] " Maxim Cournoyer
2023-04-25 18:50           ` [PATCH v3 1/3] send-email: extract execute_cmd from recipients_cmd Maxim Cournoyer
2023-04-25 18:50           ` [PATCH v3 2/3] send-email: add --header-cmd option Maxim Cournoyer
2023-04-25 18:50           ` [PATCH v3 3/3] send-email: detect empty blank lines in command output Maxim Cournoyer
2023-04-25 18:53         ` Maxim Cournoyer [this message]
2023-05-01 14:38         ` [PATCH v4 0/3] send-email: add --header-cmd option Maxim Cournoyer
2023-05-01 14:38           ` [PATCH v4 1/3] send-email: extract execute_cmd from recipients_cmd Maxim Cournoyer
2023-05-01 14:38           ` [PATCH v4 2/3] send-email: add --header-cmd, --no-header-cmd options Maxim Cournoyer
2023-05-01 14:38           ` [PATCH v4 3/3] send-email: detect empty blank lines in command output Maxim Cournoyer
2023-05-08 15:07           ` [PATCH v4 0/3] send-email: add --header-cmd option Maxim Cournoyer
2023-05-08 16:59             ` Eric Sunshine
2023-05-08 19:18               ` Maxim Cournoyer
2023-04-25 16:26     ` [PATCH v2 0/2] " Maxim Cournoyer
2023-04-25 16:26       ` [PATCH v2 1/2] send-email: extract execute_cmd from recipients_cmd Maxim Cournoyer
2023-04-25 17:04         ` Eric Sunshine
2023-04-25 19:09           ` Maxim Cournoyer
2023-05-02 18:39             ` Felipe Contreras
2023-05-02 20:46               ` Maxim Cournoyer
2023-05-02 21:50                 ` Felipe Contreras
2023-04-25 16:26       ` [PATCH v2 2/2] send-email: add --header-cmd option Maxim Cournoyer
2023-04-24 21:45 ` [PATCH 0/2] " Junio C Hamano
2023-04-25  1:50   ` Maxim Cournoyer

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=87leifpzco.fsf@gmail.com \
    --to=maxim.cournoyer@gmail.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 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.