From: Michael Strawbridge Date: Wed, 11 Oct 2023 20:22:18 GMT Subject: [PATCH] send-email: move process_address_list earlier to avoid, uninitialized address error Message-ID: <7e2c92ff-b42c-4b3f-a509-9d0785448262@amd.com> In-Reply-To: <95b9e5d5-ab07-48a6-b972-af5348f653be@amd.com> Move processing of email address lists before the sendemail-validate hook code.  This fixes email address validation errors when the optional perl module Email::Valid is installed and multiple addresses are passed in on a single to/cc argument like --to=foo@example.com,bar@example.com. ---  git-send-email.perl | 8 ++++----  1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/git-send-email.perl b/git-send-email.perl index 288ea1ae80..cfd80c9d8b 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -799,6 +799,10 @@ sub is_format_patch_arg {    $time = time - scalar $#files;   +@initial_to = process_address_list(@initial_to); +@initial_cc = process_address_list(@initial_cc); +@initial_bcc = process_address_list(@initial_bcc); +  if ($validate) {         # FIFOs can only be read once, exclude them from validation.         my @real_files = (); @@ -1099,10 +1103,6 @@ sub expand_one_alias {         return $aliases{$alias} ? expand_aliases(@{$aliases{$alias}}) : $alias;  }   -@initial_to = process_address_list(@initial_to); -@initial_cc = process_address_list(@initial_cc); -@initial_bcc = process_address_list(@initial_bcc); -  if ($thread && !defined $initial_in_reply_to && $prompting) {         $initial_in_reply_to = ask(                 __("Message-ID to be used as In-Reply-To for the first email (if any)? "), -- 2.34.1