Subject: Re: [PATCH v3] git-send-email: add option to specify sendmail command

From: Junio C Hamano <[email-masked]>
Date: Fri, 14 May 2021 14:16:58 +0900

Junio C Hamano <[email-masked]> writes:

> We want the shell that eats the command line of 'git send-email' to see
>
> 	--sendmail-cmd='$(pwd)/fake.sendmail'\" -f [email-masked]"

Eh, sorry, but this is wrong.  It would have to be something like

	--sendmail-cmd='"$(pwd)/fake.sendmail" -f [email-masked]'

The point is that the outer shell (i.e. the one that is eval'ing the
body of the test_expect_success) should just see and treat the path
to the sendmail-like program as "$(pwd)/fake.sendmail" as a literal
string including the surrounding double quotes and pass it down to
"git send-email", and the shell started by our "exec('sh','-c',...)"
thing will see what $(pwd) expands to, appends /fake.sendmail to it,
and treat the whole thing as a single "path to the program", that is
followed by two args, i.e. '-f' and [email-masked]'.

And inside test_expect_success whose body is surrounded by a pair of
sq, we'd express a sq as '\'', so it becomes

	--sendmail-cmd='\''"$(pwd)/fake.sendmail" -f [email-masked]'\''

in the test script, I would think.