From: Junio C Hamano Date: Fri, 14 May 2021 05:16:58 GMT Subject: Re: [PATCH v3] git-send-email: add option to specify sendmail command Message-ID: In-Reply-To: Junio C Hamano writes: > We want the shell that eats the command line of 'git send-email' to see > > --sendmail-cmd='$(pwd)/fake.sendmail'\" -f nobody@example.com" Eh, sorry, but this is wrong. It would have to be something like --sendmail-cmd='"$(pwd)/fake.sendmail" -f nobody@example.com' 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 'nobody@example.com'. 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 nobody@example.com'\'' in the test script, I would think.