From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C346CC433B4 for ; Fri, 14 May 2021 05:17:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8BD6E60FE3 for ; Fri, 14 May 2021 05:17:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232032AbhENFSL (ORCPT ); Fri, 14 May 2021 01:18:11 -0400 Received: from pb-smtp1.pobox.com ([64.147.108.70]:56851 "EHLO pb-smtp1.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231267AbhENFSK (ORCPT ); Fri, 14 May 2021 01:18:10 -0400 Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 56211B976D; Fri, 14 May 2021 01:16:59 -0400 (EDT) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=Uks7ubUKAnEJZYVcDDDZpSPjwlXZCBbnzcEerj wn88I=; b=SEObZXdAj2LHVKYWF9aDILMfNEAjD362Qbf/URf8VBH0iVfmWEoR5l p7iRC1gGm1JemLfI3Iy7DjW/M/aEcAWelzVSgbEzM6zqFd6AXzTXGxRJOG4iW82q EcWFS9sc5l12JrY6rmn3tikJ6JYTQwEUGCJIRKsiVGo/HWgolVzwo= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 4DB3AB976C; Fri, 14 May 2021 01:16:59 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [34.74.119.39]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id C579CB976A; Fri, 14 May 2021 01:16:58 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: Gregory Anders Cc: git@vger.kernel.org Subject: Re: [PATCH v3] git-send-email: add option to specify sendmail command References: <20210513023212.72221-1-greg@gpanders.com> <20210513152329.22578-1-greg@gpanders.com> Date: Fri, 14 May 2021 14:16:58 +0900 In-Reply-To: (Junio C. Hamano's message of "Fri, 14 May 2021 13:25:09 +0900") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 9B8360FC-B473-11EB-8B29-D152C8D8090B-77302942!pb-smtp1.pobox.com Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org 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.