From: Junio C Hamano <gitster@pobox.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: "Strawbridge, Michael" <Michael.Strawbridge@amd.com>,
"git@vger.kernel.org" <git@vger.kernel.org>,
"Tuikov, Luben" <Luben.Tuikov@amd.com>
Subject: Re: [PATCH v5 1/2] send-email: refactor header generation functions
Date: Tue, 17 Jan 2023 07:13:45 -0800 [thread overview]
Message-ID: <xmqqv8l59ot2.fsf@gitster.g> (raw)
In-Reply-To: <230117.86wn5lxpl0.gmgdl@evledraar.gmail.com> (=?utf-8?B?IsOG?= =?utf-8?B?dmFyIEFybmZqw7Zyw7A=?= Bjarmason"'s message of "Tue, 17 Jan 2023 14:20:58 +0100")
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
>> +sub send_message {
>> + my ($recipients_ref, $to, $date, $gitversion, $cc, $ccline, $header) = gen_header();
>
> This makes the diff smaller, but if we're refactoring these functions to
> return arguments it's probably better to return a hash reference rather
> than remembering all the parameter names.
>
> But in this case it's probably fine...
> ...
>> +sub pre_process_file {
>> + my ($t, $quiet) = @_;
>
> This, I think, is an anti-pattern in this file. We can just read the
> "$quiet" and other things that we set up when we parse the parameters as
> globals, we don't need to pass them as named parameters.
>
> It doesn't help readability to shadow that variable with another lexical
> here below:
> ...
Thanks as usual for a careful review, with concrete suggestions for
improvements.
next prev parent reply other threads:[~2023-01-17 15:14 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-10 21:16 [PATCH v5 0/2] send-email: expose header information to git-send-email's sendemail-validate hook Strawbridge, Michael
2023-01-10 21:16 ` [PATCH v5 1/2] send-email: refactor header generation functions Strawbridge, Michael
2023-01-17 13:20 ` Ævar Arnfjörð Bjarmason
2023-01-17 15:13 ` Junio C Hamano [this message]
2023-01-17 21:36 ` Strawbridge, Michael
2023-01-10 21:16 ` [PATCH v5 2/2] send-email: expose header information to git-send-email's sendemail-validate hook Strawbridge, Michael
2023-01-14 1:17 ` Junio C Hamano
2023-01-14 16:03 ` Junio C Hamano
2023-01-14 16:06 ` Junio C Hamano
2023-01-15 3:34 ` Junio C Hamano
2023-01-17 4:09 ` Luben Tuikov
2023-01-17 4:29 ` Junio C Hamano
2023-01-17 4:56 ` Luben Tuikov
2023-01-17 13:23 ` Ævar Arnfjörð Bjarmason
2023-01-17 21:58 ` Strawbridge, Michael
2023-01-17 1:49 ` [PATCH v5 0/2] " Strawbridge, Michael
2023-01-17 1:37 Strawbridge, Michael
2023-01-17 1:37 ` [PATCH v5 1/2] send-email: refactor header generation functions Strawbridge, Michael
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=xmqqv8l59ot2.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=Luben.Tuikov@amd.com \
--cc=Michael.Strawbridge@amd.com \
--cc=avarab@gmail.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 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).