Subject: Re: [PATCH v3 3/3] send-email: add test for Linux's get_maintainer.pl

From: Junio C Hamano <[email-masked]>
Date: Mon, 08 Jan 2018 10:45:13 -0800

Matthieu Moy <[email-masked]> writes:

> From: Alex Bennée <[email-masked]>
>
> We had a regression that broke Linux's get_maintainer.pl. Using
> Mail::Address to parse email addresses fixed it, but let's protect
> against future regressions.
>
> Note that we need --cc-cmd to be relative because this option doesn't
> accept spaces in script names (probably to allow --cc-cmd="executable
> --option"), while --smtp-server needs to be absolute.
>
> Patch-edited-by: Matthieu Moy <[email-masked]>
> Signed-off-by: Alex Bennée <[email-masked]>
> Signed-off-by: Matthieu Moy <[email-masked]>
> ---
> Change since v2:
>
> * Mention relative Vs absolute path in commit message.
>
> * Remove useless "chmod +x"
>
> * Remove useless double quotes
>
>  t/t9001-send-email.sh | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)

Thanks, both.  

"while --smtp-server needs to be ..." gave a "Huh?" for somebody who
weren't familiar with the discussion that led to the addition of
that note (i.e. "unlike a near-by test that passes a full-path
$(pwd)/fake.endmail to --smtp-server" would have helped); it is not
a big deal, though.

Let's merge this to 'next' and try to merge in the first batch post
the release.

Thanks.

> diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
> index 4d261c2..a06e5d7 100755
> --- a/t/t9001-send-email.sh
> +++ b/t/t9001-send-email.sh
> @@ -172,6 +172,25 @@ test_expect_success $PREREQ 'cc trailer with various syntax' '
>  	test_cmp expected-cc commandline1
>  '
>  
> +test_expect_success $PREREQ 'setup fake get_maintainer.pl script for cc trailer' "
> +	write_script expected-cc-script.sh <<-EOF
> +	echo 'One Person <[email-masked]> (supporter:THIS (FOO/bar))'
> +	echo 'Two Person <[email-masked]> (maintainer:THIS THING)'
> +	echo 'Third List <[email-masked]> (moderated list:THIS THING (FOO/bar))'
> +	echo '<[email-masked]> (moderated list:FOR THING)'
> +	echo [email-masked] (open list:FOR THING (FOO/bar))'
> +	echo [email-masked] (open list)'
> +	EOF
> +"
> +
> +test_expect_success $PREREQ 'cc trailer with get_maintainer.pl output' '
> +	clean_fake_sendmail &&
> +	git send-email -1 --to=[email-masked] \
> +		--cc-cmd=./expected-cc-script.sh \
> +		--smtp-server="$(pwd)/fake.sendmail" &&
> +	test_cmp expected-cc commandline1
> +'
> +
>  test_expect_success $PREREQ 'setup expect' "
>  cat >expected-show-all-headers <<\EOF
>  0001-Second.patch