git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
May 14, 2021, 05:16 UTC
Message-ID
<xmqq1ra999o5.fsf@gitster.g>
In-Reply-To
<xmqq7dk27xi2.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> 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.
Previous: Junio C HamanoNext: Gregory Anders
Message 17 of 19 in “git-send-email: add sendmailCommand option”
  1. git-send-email: add sendmailCommand optionGregory Anders, May 12, 2021
  2. Junio C HamanoMay 12, 2021
  3. Gregory AndersMay 12, 2021
  4. Felipe ContrerasMay 12, 2021
  5. Gregory AndersMay 12, 2021
  6. Felipe ContrerasMay 12, 2021
  7. Gregory AndersMay 12, 2021
  8. Felipe ContrerasMay 12, 2021
  9. Ævar Arnfjörð BjarmasonMay 12, 2021
  10. Gregory AndersMay 12, 2021
  11. git-send-email: add option to specify sendmail commandGregory Anders, May 13, 2021
  12. Junio C HamanoMay 13, 2021
  13. Gregory AndersMay 13, 2021
  14. Junio C HamanoMay 13, 2021
  15. git-send-email: add option to specify sendmail commandGregory Anders, May 13, 2021
  16. Junio C HamanoMay 14, 2021
  17. Junio C HamanoMay 14, 2021
  18. Gregory AndersMay 14, 2021
  19. git-send-email: add option to specify sendmail commandGregory Anders, May 14, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.