all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Arun Isaac <arunisaac@systemreboot.net>
To: 63802@debbugs.gnu.org
Cc: Arun Isaac <arunisaac@systemreboot.net>,
	Arun Isaac <arunisaac@systemreboot.net>,
	Maxim Cournoyer <maxim.cournoyer@gmail.com>
Subject: [bug#63802] [PATCH 3/3] client: Use mumi git-send-email-headers subcommand.
Date: Mon, 17 Jul 2023 23:19:21 +0100	[thread overview]
Message-ID: <20230717221921.28889-3-arunisaac@systemreboot.net> (raw)
In-Reply-To: <20230717221921.28889-1-arunisaac@systemreboot.net>

* mumi/client.scm (send-email): Accept mumi-command argument and use
it to construct --header-cmd.
* scripts/mumi.in: Pass command 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  | 10 +++++++---
 scripts/mumi.in  |  2 +-
 tests/client.scm | 17 ++++++++++++++---
 3 files changed, 22 insertions(+), 7 deletions(-)

diff --git a/mumi/client.scm b/mumi/client.scm
index 797ec91..6ac69f9 100644
--- a/mumi/client.scm
+++ b/mumi/client.scm
@@ -292,8 +292,9 @@ ISSUE-NUMBER."
           (() (list))
           (cc (list (cons 'cc (string-join cc ", "))))))))
 
-(define (send-email patches)
-  "Send PATCHES via email."
+(define (send-email mumi-command patches)
+  "Send PATCHES via email. MUMI-COMMAND is the mumi program currently
+invoked."
   (if (current-issue-number)
       ;; If an issue is current, send patches to that issue's email
       ;; address.
@@ -301,7 +302,10 @@ ISSUE-NUMBER."
         (git-send-email (string-append (number->string issue-number)
                                        "@"
                                        (client-config 'debbugs-host))
-                        patches))
+                        patches
+                        (list (string-append "--header-cmd="
+                                             mumi-command
+                                             " 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 ced573b..d28bc1a 100644
--- a/tests/client.scm
+++ b/tests/client.scm
@@ -99,10 +99,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*)
@@ -114,6 +117,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"
@@ -127,10 +131,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*)
@@ -142,10 +149,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*)
@@ -157,6 +167,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")
-- 
2.39.2





      parent reply	other threads:[~2023-07-17 22:20 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-30 12:11 [bug#63802] [mumi PATCH 0/3] Use consolidated X-Debbugs-Cc header Arun Isaac
2023-05-30 12:14 ` [bug#63802] [mumi PATCH 1/3] client: Do not pass --add-header to git send-email Arun Isaac
2023-05-30 12:14   ` [bug#63802] [mumi PATCH 2/3] client: Add git-send-email-headers subcommand Arun Isaac
2023-06-05  2:31     ` Maxim Cournoyer
2023-06-08 17:09       ` Arun Isaac
2023-06-08 17:29         ` Arun Isaac
2023-05-30 12:14   ` [bug#63802] [mumi PATCH 3/3] client: Use mumi " Arun Isaac
2023-06-05  2:36     ` Maxim Cournoyer
2023-06-05  2:21   ` [bug#63802] [mumi PATCH 1/3] client: Do not pass --add-header to git send-email Maxim Cournoyer
2023-06-08 17:14 ` [bug#63802] [PATCH 1/3] client: Separate serialize-email-address into a function Arun Isaac
2023-06-08 17:14   ` [bug#63802] [PATCH 2/3] client: Add git-send-email-headers subcommand Arun Isaac
2023-07-16  3:39     ` [bug#63802] [mumi PATCH 0/3] Use consolidated X-Debbugs-Cc header Maxim Cournoyer
2023-07-17 22:14       ` Arun Isaac
2023-07-18 15:32         ` Maxim Cournoyer
2023-07-19 16:49           ` bug#63802: " Arun Isaac
2023-06-08 17:14   ` [bug#63802] [PATCH 3/3] client: Use mumi git-send-email-headers subcommand Arun Isaac
2023-07-16  4:01     ` [bug#63802] [mumi PATCH 0/3] Use consolidated X-Debbugs-Cc header Maxim Cournoyer
2023-07-17 22:14       ` Arun Isaac
2023-07-16  3:14   ` Maxim Cournoyer
2023-07-17 22:19 ` [bug#63802] [PATCH 1/3] client: Separate serialize-email-address into a procedure Arun Isaac
2023-07-17 22:19   ` [bug#63802] [PATCH 2/3] client: Add git-send-email-headers subcommand Arun Isaac
2023-07-17 22:19   ` Arun Isaac [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230717221921.28889-3-arunisaac@systemreboot.net \
    --to=arunisaac@systemreboot.net \
    --cc=63802@debbugs.gnu.org \
    --cc=maxim.cournoyer@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.