Thread (1 message) 1 message, 1 author, 2023-01-17

Re: [PATCH v5 1/2] send-email: refactor header generation functions

From: Junio C Hamano <hidden>
Date: 2023-01-17 15:14:07

Ævar Arnfjörð Bjarmason [off-list ref] writes:
quoted
+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...
...
quoted
+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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help