From patchwork Tue May 30 12:14:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Isaac X-Patchwork-Id: 50489 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 2410227BBE9; Tue, 30 May 2023 13:16:45 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 5B8A027BBE2 for ; Tue, 30 May 2023 13:16:43 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q3yGs-0005nH-3F; Tue, 30 May 2023 08:16:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q3yGg-0005eg-Kj for guix-patches@gnu.org; Tue, 30 May 2023 08:16:08 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q3yGg-0006Fs-CL for guix-patches@gnu.org; Tue, 30 May 2023 08:16:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q3yGf-0004zg-Rt for guix-patches@gnu.org; Tue, 30 May 2023 08:16:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63802] [mumi PATCH 1/3] client: Do not pass --add-header to git send-email. References: <20230530121132.26057-1-arunisaac@systemreboot.net> In-Reply-To: <20230530121132.26057-1-arunisaac@systemreboot.net> Resent-From: Arun Isaac Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 30 May 2023 12:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63802 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63802@debbugs.gnu.org Cc: Arun Isaac , Maxim Cournoyer Received: via spool by 63802-submit@debbugs.gnu.org id=B63802.168544892019114 (code B ref 63802); Tue, 30 May 2023 12:16:01 +0000 Received: (at 63802) by debbugs.gnu.org; 30 May 2023 12:15:20 +0000 Received: from localhost ([127.0.0.1]:60365 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3yFz-0004yD-Lr for submit@debbugs.gnu.org; Tue, 30 May 2023 08:15:20 -0400 Received: from mugam.systemreboot.net ([139.59.75.54]:37734) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3yFx-0004y1-3I for 63802@debbugs.gnu.org; Tue, 30 May 2023 08:15:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=systemreboot.net; s=default; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=yUlYpvfQWxzu+iyIo3RJYtjbgXmZFCK8ueJflisrn/Y=; b=Jy36cEjs5oXwUbUuJC2dXwyphn rM0ew37HoTMPlszbQmNp4Rur7TtuGTZl/GO1Yjh9fsKuAoi+DvgPEE5PCakfsnonkzt8/5Ao5ouWY AU04BbFmFiHyuWEBtxmAScL3MnaMyMlazzvSS6nIQmVcyh/ORm+sxEs/JRWRgcSX8bkgUdSOC/t0E Wh19Vb9Qt4Vp7ymhSKDGGEJNIeujfntAXlJx4p/FO8nXBelHfF7Q0FdJ4PAaxT/uy0O5w5uR2QE2L owFZSnrhX4RpAX9t5L5y2kPOUWU7XIxK9PX8iKGkuubC7gP5l2sy3OBOKHRZeAlT5KEDIei5SodyW poR0V28Q==; Received: from [192.168.2.1] (port=38898 helo=localhost.localdomain) by systemreboot.net with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1q3yFq-001s3y-1K; Tue, 30 May 2023 13:15:11 +0100 From: Arun Isaac Date: Tue, 30 May 2023 13:14:45 +0100 Message-Id: <20230530121447.26236-1-arunisaac@systemreboot.net> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches git send-email accepts --add-header only when passed a git format-patch style revision list. * mumi/client.scm (send-email): Do not pass --add-header to git-send-email. * tests/client.scm ("send patch to existing issue and Cc other participants"): Do not expect --add-header. --- mumi/client.scm | 5 +---- tests/client.scm | 6 +----- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/mumi/client.scm b/mumi/client.scm index b575daa..5befd42 100644 --- a/mumi/client.scm +++ b/mumi/client.scm @@ -287,10 +287,7 @@ ISSUE-NUMBER." (git-send-email (string-append (number->string issue-number) "@" (client-config 'debbugs-host)) - patches - (map (cut string-append "--add-header=X-Debbugs-Cc: " <>) - (assq-ref (reply-email-headers issue-number) - 'cc)))) + patches)) (match patches ;; If it's a single patch, send it to the patch email address ;; and be done with it diff --git a/tests/client.scm b/tests/client.scm index 5729521..5352b08 100644 --- a/tests/client.scm +++ b/tests/client.scm @@ -126,11 +126,7 @@ called with." (list "foo.patch"))))))) (test-equal "send patch to existing issue and Cc other participants" - '(("git" "send-email" - "--to=12345@example.com" - "--add-header=X-Debbugs-Cc: John Doe " - "--add-header=X-Debbugs-Cc: Mary Smith " - "foo.patch")) + '(("git" "send-email" "--to=12345@example.com" "foo.patch")) (map (match-lambda ((command _) command)) (trace-calls (var@@ (mumi client) call-with-input-pipe*) From patchwork Tue May 30 12:14:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Isaac X-Patchwork-Id: 50490 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id ACFAA27BBEA; Tue, 30 May 2023 13:16:50 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id E13FC27BBE2 for ; Tue, 30 May 2023 13:16:49 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q3yGt-0005nQ-4K; Tue, 30 May 2023 08:16:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q3yGg-0005eh-MQ for guix-patches@gnu.org; Tue, 30 May 2023 08:16:08 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q3yGg-0006Fx-EK for guix-patches@gnu.org; Tue, 30 May 2023 08:16:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q3yGg-0004zt-9k for guix-patches@gnu.org; Tue, 30 May 2023 08:16:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63802] [mumi PATCH 2/3] client: Add git-send-email-headers subcommand. Resent-From: Arun Isaac Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 30 May 2023 12:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63802 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63802@debbugs.gnu.org Cc: Arun Isaac , Maxim Cournoyer Received: via spool by 63802-submit@debbugs.gnu.org id=B63802.168544892419141 (code B ref 63802); Tue, 30 May 2023 12:16:02 +0000 Received: (at 63802) by debbugs.gnu.org; 30 May 2023 12:15:24 +0000 Received: from localhost ([127.0.0.1]:60368 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3yG4-0004yd-29 for submit@debbugs.gnu.org; Tue, 30 May 2023 08:15:24 -0400 Received: from mugam.systemreboot.net ([139.59.75.54]:37738) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3yFz-0004y5-0e for 63802@debbugs.gnu.org; Tue, 30 May 2023 08:15:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=systemreboot.net; s=default; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=k4WIF/8ImVOTSX34H7i2lVUfFPW37agFqivrA/NI1RQ=; b=CSAruXzdrIwOfdgX0D2PiYhA9D YpS3h4qZ5I9bKGP4vBEtS+bt99RCTSi0+wUj0vf+Bqgd+jvcaA6xy012FRbZiy+mX7q78wQIGy+f6 29/TzPww9+mAJ9QFCXe4zdRau4lzS2u19XyNikQCPXtVAb0uI4sKb4LLu4LpfD2ona/v0N/SofFpM 15ZPbrBAHDOiZGx3tPA6y0Jo8wrgw4sNyty16iHaXsjhTjqiJ7440lHECyAUJQp3WJGqyY8KUIX3q /v/bgq1mX9QLPgKy5OMsQnkN5HwN0S1KdcC55gaMDUPJJvO/VNQdyoACif2ekZsjweqWI9dsTlb+0 QD3FTggQ==; Received: from [192.168.2.1] (port=38898 helo=localhost.localdomain) by systemreboot.net with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1q3yFu-001s3y-14; Tue, 30 May 2023 13:15:15 +0100 From: Arun Isaac Date: Tue, 30 May 2023 13:14:46 +0100 Message-Id: <20230530121447.26236-2-arunisaac@systemreboot.net> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230530121447.26236-1-arunisaac@systemreboot.net> References: <20230530121447.26236-1-arunisaac@systemreboot.net> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * mumi/client.scm: Import (rnrs exceptions). (git-send-email-headers): New public function. * scripts/mumi.in: Add git-send-email-headers subcommand. --- mumi/client.scm | 42 +++++++++++++++++++++++++++++++++++++++++- scripts/mumi.in | 2 ++ 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/mumi/client.scm b/mumi/client.scm index 5befd42..c70fe61 100644 --- a/mumi/client.scm +++ b/mumi/client.scm @@ -17,6 +17,7 @@ ;;; along with mumi. If not, see . (define-module (mumi client) + #:use-module (rnrs exceptions) #:use-module (rnrs io ports) #:use-module (srfi srfi-1) #:use-module (srfi srfi-19) @@ -38,7 +39,9 @@ print-current-issue set-current-issue! clear-current-issue! - send-email)) + send-email + git-send-email-headers + compose)) (define (git-top-level) "Return the top-level directory of the current git repository." @@ -306,3 +309,40 @@ ISSUE-NUMBER." "@" (client-config 'debbugs-host)) other-patches))))) + +(define (git-send-email-headers patch) + "Print send-email headers for PATCH." + (let* (;; Compute headers if configured in git config. + (header-command + (guard (ex (#t #f)) + (call-with-input-pipe* (list "git" "config" "sendemail.headerCmd") + get-line))) + (headers + (if header-command + (call-with-input-pipe (string-append header-command " " patch) + get-string-all) + "")) + (external-x-debbugs-cc + (assq-ref (parse-email-headers + (string-append (string-trim-right headers #\newline) + "\n")) + 'x-debbugs-cc)) + ;; Fetch Cc addresses for current issue. + (x-debbugs-cc + (assq-ref (reply-email-headers (current-issue-number)) + 'cc))) + ;; Print X-Debbugs-Cc header. + (when (or x-debbugs-cc external-x-debbugs-cc) + (display "X-Debbugs-Cc: ") + (display (if (and x-debbugs-cc external-x-debbugs-cc) + (string-append x-debbugs-cc ", " external-x-debbugs-cc) + (or x-debbugs-cc external-x-debbugs-cc))) + (newline)) + ;; Print headers other than X-Debbugs-Cc. + ;; TODO: RFC5322 headers are not restricted to a single + ;; line. "Folded" multi-line headers are allowed. Support them. + (for-each (lambda (line) + (unless (string-prefix-ci? "X-Debbugs-Cc:" line) + (display line) + (newline))) + (string-split headers #\newline)))) diff --git a/scripts/mumi.in b/scripts/mumi.in index 2295328..8fb7cd4 100644 --- a/scripts/mumi.in +++ b/scripts/mumi.in @@ -163,6 +163,8 @@ (client:clear-current-issue!)) (("send-email" . patches) (client:send-email patches)) + (("git-send-email-headers" patch) + (client:git-send-email-headers patch)) (("mailer" . rest) (let* ((opts (parse-options rest)) (sender (assoc-ref opts 'sender)) From patchwork Tue May 30 12:14:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Isaac X-Patchwork-Id: 50488 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 26E5827BBE9; Tue, 30 May 2023 13:16:32 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id DB2A727BBE2 for ; Tue, 30 May 2023 13:16:29 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q3yGz-0005oW-H8; Tue, 30 May 2023 08:16:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q3yGh-0005eo-AD for guix-patches@gnu.org; Tue, 30 May 2023 08:16:08 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q3yGg-0006GB-S6 for guix-patches@gnu.org; Tue, 30 May 2023 08:16:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q3yGg-000507-Mo for guix-patches@gnu.org; Tue, 30 May 2023 08:16:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63802] [mumi PATCH 3/3] client: Use mumi git-send-email-headers subcommand. Resent-From: Arun Isaac Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 30 May 2023 12:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63802 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63802@debbugs.gnu.org Cc: Arun Isaac , Maxim Cournoyer Received: via spool by 63802-submit@debbugs.gnu.org id=B63802.168544892519147 (code B ref 63802); Tue, 30 May 2023 12:16:02 +0000 Received: (at 63802) by debbugs.gnu.org; 30 May 2023 12:15:25 +0000 Received: from localhost ([127.0.0.1]:60370 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3yG4-0004yg-PI for submit@debbugs.gnu.org; Tue, 30 May 2023 08:15:25 -0400 Received: from mugam.systemreboot.net ([139.59.75.54]:37746) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3yG1-0004yN-I6 for 63802@debbugs.gnu.org; Tue, 30 May 2023 08:15:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=systemreboot.net; s=default; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=EH0wzgtfXZeFw+mOFLJG09BispslagQMEE2KeRQsdAA=; b=MagmIp0OTqh6waMFBvaVcTFUxF C3hv/wQDZAUF6DBvS0+icF1oggWvi6Pq1cNoOg1cfsY9OETcZpOmV3Ept3fAphnJIJdALbXHJl8MK AiesFlznkqRYcTOFXBQ9IILIjJnbslg+KdUAj5AEShvoAZv1rHGPgNITbiXIfbQUwrruL1Q329QAh hvco9HBeFsC1kSnWHDIrGQ30u2vZk616ViE/7jAAwGfgeEXVi3JyWscqk60S64q5wWwUKnMyUeYnO mwtxOt6JCq6HxQh6JgDnJRq0cTFHv0C5MaO1TCckeY89r9XKXe6hivQ7xNYL23jI42mxw6sxyuwKs fx2WzZgg==; Received: from [192.168.2.1] (port=38898 helo=localhost.localdomain) by systemreboot.net with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1q3yFw-001s3y-2h; Tue, 30 May 2023 13:15:17 +0100 From: Arun Isaac Date: Tue, 30 May 2023 13:14:47 +0100 Message-Id: <20230530121447.26236-3-arunisaac@systemreboot.net> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230530121447.26236-1-arunisaac@systemreboot.net> References: <20230530121447.26236-1-arunisaac@systemreboot.net> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * mumi/client.scm (send-email): Accept mumi-arg0 argument and use it to construct --header-cmd. * scripts/mumi.in: Pass arg0 to send-email. * tests/client.scm ("send patches to new issue", "send patches to existing issue", "send single patch to new issue", "send single patch to existing issue", "send patch to existing issue and Cc other participants"): Adjust tests. --- mumi/client.scm | 9 ++++++--- scripts/mumi.in | 2 +- tests/client.scm | 17 ++++++++++++++--- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/mumi/client.scm b/mumi/client.scm index c70fe61..9cb2bd8 100644 --- a/mumi/client.scm +++ b/mumi/client.scm @@ -281,8 +281,9 @@ ISSUE-NUMBER." (() (list)) (cc (list (cons 'cc (string-join cc ", ")))))))) -(define (send-email patches) - "Send PATCHES via email." +(define (send-email mumi-arg0 patches) + "Send PATCHES via email. MUMI-ARG0 is the mumi program currently +invoked." (if (current-issue-number) ;; If an issue is current, send patches to that issue's email ;; address. @@ -290,7 +291,9 @@ ISSUE-NUMBER." (git-send-email (string-append (number->string issue-number) "@" (client-config 'debbugs-host)) - patches)) + patches + (list (string-append "--header-cmd=" + mumi-arg0 " git-send-email-headers")))) (match patches ;; If it's a single patch, send it to the patch email address ;; and be done with it diff --git a/scripts/mumi.in b/scripts/mumi.in index 8fb7cd4..5b98634 100644 --- a/scripts/mumi.in +++ b/scripts/mumi.in @@ -162,7 +162,7 @@ (("new") (client:clear-current-issue!)) (("send-email" . patches) - (client:send-email patches)) + (client:send-email (car (program-arguments)) patches)) (("git-send-email-headers" patch) (client:git-send-email-headers patch)) (("mailer" . rest) diff --git a/tests/client.scm b/tests/client.scm index 5352b08..fa80dad 100644 --- a/tests/client.scm +++ b/tests/client.scm @@ -80,10 +80,13 @@ called with." (const 12345)) client-config-stub) (cut (@@ (mumi client) send-email) + "mumi" (list "foo.patch" "bar.patch" "foobar.patch"))))))) (test-equal "send patches to existing issue" - '(("git" "send-email" "--to=12345@example.com" "foo.patch" "bar.patch" "foobar.patch")) + '(("git" "send-email" "--to=12345@example.com" + "--header-cmd=mumi git-send-email-headers" + "foo.patch" "bar.patch" "foobar.patch")) (map (match-lambda ((command _) command)) (trace-calls (var@@ (mumi client) call-with-input-pipe*) @@ -95,6 +98,7 @@ called with." client-config-stub do-not-poll-server-for-issue-number) (cut (@@ (mumi client) send-email) + "mumi" (list "foo.patch" "bar.patch" "foobar.patch"))))))) (test-equal "send single patch to new issue" @@ -108,10 +112,13 @@ called with." client-config-stub do-not-poll-server-for-issue-number) (cut (@@ (mumi client) send-email) + "mumi" (list "foo.patch"))))))) (test-equal "send single patch to existing issue" - '(("git" "send-email" "--to=12345@example.com" "foo.patch")) + '(("git" "send-email" "--to=12345@example.com" + "--header-cmd=mumi git-send-email-headers" + "foo.patch")) (map (match-lambda ((command _) command)) (trace-calls (var@@ (mumi client) call-with-input-pipe*) @@ -123,10 +130,13 @@ called with." client-config-stub do-not-poll-server-for-issue-number) (cut (@@ (mumi client) send-email) + "mumi" (list "foo.patch"))))))) (test-equal "send patch to existing issue and Cc other participants" - '(("git" "send-email" "--to=12345@example.com" "foo.patch")) + '(("git" "send-email" "--to=12345@example.com" + "--header-cmd=mumi git-send-email-headers" + "foo.patch")) (map (match-lambda ((command _) command)) (trace-calls (var@@ (mumi client) call-with-input-pipe*) @@ -138,6 +148,7 @@ called with." client-config-stub do-not-poll-server-for-issue-number) (cut (@@ (mumi client) send-email) + "mumi" (list "foo.patch"))))))) (test-end "client")