unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: 58813@debbugs.gnu.org
Cc: ludo@gnu.org, liliana.prikler@gmail.com,
	Maxim Cournoyer <maxim.cournoyer@gmail.com>,
	zimon.toutoune@gmail.com
Subject: bug#58813: [PATCH 2/5] teams: Add 'cc-members-header-cmd' action.
Date: Sun, 23 Apr 2023 12:04:12 -0400	[thread overview]
Message-ID: <2c8e1e7fe43d6460f3cc4c2b77d649e109030eb3.1682265703.git.maxim.cournoyer@gmail.com> (raw)
In-Reply-To: <878rg4snrf.fsf@gmail.com>

* etc/teams.scm.in (patch->teams): New procedure.
(main): Use it.  Add a new "cc-members-header-cmd" command; document it.
---
 etc/teams.scm.in | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/etc/teams.scm.in b/etc/teams.scm.in
index 37a3c8e191..408db8b7d5 100644
--- a/etc/teams.scm.in
+++ b/etc/teams.scm.in
@@ -5,7 +5,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2022, 2023 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2022 Mathieu Othacehe <othacehe@gnu.org>
-;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -696,6 +696,12 @@ (define (git-patch->revisions file)
          (rev-start (string-append rev-end "^")))
     (list rev-start rev-end)))
 
+(define (patch->teams patch-file)
+  "Return the name of the teams in scope for the changes in PATCH-FILE."
+  (map (compose symbol->string team-id)
+       (find-team-by-scope (apply diff-revisions
+                                  (git-patch->revisions patch-file)))))
+
 \f
 (define (main . args)
   (match args
@@ -708,11 +714,13 @@ (define (main . args)
     (("cc-members" rev-start rev-end)
      (apply cc (find-team-by-scope
                 (diff-revisions rev-start rev-end))))
+    (("cc-members-header-cmd" patch-file)
+     (for-each (lambda (team-name)
+                 (list-members (find-team team-name) (current-output-port)
+                               "X-Debbugs-Cc: "))
+               (patch->teams patch-file)))
     (("get-maintainer" patch-file)
-     (apply main "list-members"
-            (map (compose symbol->string team-id)
-                 (find-team-by-scope (apply diff-revisions
-                                            (git-patch->revisions patch-file))))))
+     (apply main "list-members" (patch->teams patch-file)))
     (("list-teams" . args)
      (list-teams))
     (("list-members" . team-names)
@@ -729,6 +737,8 @@ (define (main . args)
       get git send-email flags for cc-ing <team-name>
   cc-members <start> <end> | patch
       cc teams related to files changed between revisions or in a patch file
+  cc-members-header-cmd <patch>
+      cc-members variant for use with 'git send-email --header-cmd'
   list-teams
       list teams and their members
   list-members <team-name>
-- 
2.39.2





  parent reply	other threads:[~2023-04-23 16:05 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-27  3:50 bug#58813: can't substitute etc/teams.scm command as doc suggests Maxim Cournoyer
2022-10-27  6:08 ` Liliana Marie Prikler
2022-10-27 12:40   ` Maxim Cournoyer
2022-10-27 16:27     ` Liliana Marie Prikler
2023-02-26  3:55 ` bug#58813: [PATCH] doc: Document how to use Patman for patches submission Maxim Cournoyer
2023-02-26  8:25   ` Liliana Marie Prikler
2023-02-26 17:11     ` Maxim Cournoyer
2023-02-27  0:45       ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
2023-02-27 16:43         ` Maxim Cournoyer
2023-03-03  9:54   ` Ludovic Courtès
2023-03-03 17:26     ` Liliana Marie Prikler
2023-03-06 14:53       ` bug#58813: ‘guix style’ flaws Ludovic Courtès
2023-03-06 17:42         ` Maxim Cournoyer
2023-03-07  1:07     ` bug#58813: [PATCH] doc: Document how to use Patman for patches submission Maxim Cournoyer
2023-03-10  9:01       ` Ludovic Courtès
2023-03-10 14:07         ` Maxim Cournoyer
2023-04-23 16:04           ` bug#58813: [PATCH 0/5] Fix teams.scm by use of a new --header-cmd git send-email option Maxim Cournoyer
2023-04-23 16:04           ` bug#58813: [PATCH 1/5] gnu: git: Apply patch adding the --header-cmd feature Maxim Cournoyer
2023-04-23 17:00             ` Liliana Marie Prikler
2023-04-24  0:46               ` Maxim Cournoyer
2023-04-23 16:04           ` Maxim Cournoyer [this message]
2023-04-23 16:04           ` bug#58813: [PATCH 3/5] teams: Add a configure-git action Maxim Cournoyer
2023-04-23 17:03             ` Liliana Marie Prikler
2023-04-24  0:59               ` Maxim Cournoyer
2023-04-24  2:29               ` bug#58813: [PATCH v2 0/5] Fix teams.scm by use of a new --header-cmd git send-email option Maxim Cournoyer
2023-04-24  2:29               ` bug#58813: [PATCH v2 1/5] gnu: git: Apply patch adding the --header-cmd feature Maxim Cournoyer
2023-04-24  2:29               ` bug#58813: [PATCH v2 2/5] teams: Add 'cc-members-header-cmd' action Maxim Cournoyer
2023-04-24  2:29               ` bug#58813: [PATCH v2 3/5] Makefile.am: Auto-configure Git on 'make' Maxim Cournoyer
2023-04-24  4:22                 ` Liliana Marie Prikler
2023-04-24 12:37                   ` Maxim Cournoyer
2023-04-28 14:28                 ` Josselin Poiret via Bug reports for GNU Guix
2023-05-01 16:38                   ` bug#58813: can't substitute etc/teams.scm command as doc suggests Maxim Cournoyer
2023-04-24  2:29               ` bug#58813: [PATCH v2 4/5] teams: Add a 'cc-mentors-header-cmd' action Maxim Cournoyer
2023-04-24  2:29               ` bug#58813: [PATCH v2 5/5] doc: Simplify contributing section by automating git configuration Maxim Cournoyer
2023-04-23 16:04           ` bug#58813: [PATCH 4/5] teams: Add a 'cc-mentors-header-cmd' action Maxim Cournoyer
2023-04-23 16:04           ` bug#58813: [PATCH 5/5] doc: Simplify contributing section by automating git configuration Maxim Cournoyer
2023-03-07 11:35 ` bug#58813: [PATCH v2] doc: Document how to use Patman for patches submission Simon Tournier
2023-03-07 16:46   ` Maxim Cournoyer
2023-03-07 17:39     ` Simon Tournier
2023-03-08  5:29       ` Liliana Marie Prikler
2023-03-08  8:47         ` Simon Tournier
2023-03-08 16:26           ` Maxim Cournoyer
2023-03-08 17:05             ` Simon Tournier

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=2c8e1e7fe43d6460f3cc4c2b77d649e109030eb3.1682265703.git.maxim.cournoyer@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=58813@debbugs.gnu.org \
    --cc=liliana.prikler@gmail.com \
    --cc=ludo@gnu.org \
    --cc=zimon.toutoune@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).