Subject: Re: [PATCH] git-send-email.perl: avoid printing undef when validating addresses

From: Junio C Hamano <[email-masked]>
Date: Mon, 18 Sep 2023 12:04:19 -0700

Taylor Blau <[email-masked]> writes:

> diff --git a/git-send-email.perl b/git-send-email.perl
> index 897cea6564..288ea1ae80 100755
> --- a/git-send-email.perl
> +++ b/git-send-email.perl
> @@ -1166,10 +1166,10 @@ sub extract_valid_address {
>  
>  sub extract_valid_address_or_die {
>  	my $address = shift;
> +	my $valid_address = extract_valid_address($address);
>  	die sprintf(__("error: unable to extract a valid address from: %s\n"), $address)
> +		if !$valid_address;
> +	return $valid_address;

This will still use undef if the incoming $address is already undef,
but the caller deserves what it gets in such a case.  The message
reports that the %s is the source from which the code tried to
extract the address from, not the result of failed extraction, so
the rewrite is absolutely the right thing to do.

Will queue.  Thanks.

>  }
>  sub validate_address {