[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#58813: [PATCH v2 2/5] teams: Add 'cc-members-header-cmd' action.
From: |
Maxim Cournoyer |
Subject: |
bug#58813: [PATCH v2 2/5] teams: Add 'cc-members-header-cmd' action. |
Date: |
Sun, 23 Apr 2023 22:29:24 -0400 |
* 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)))))
+
(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
- bug#58813: [PATCH 3/5] teams: Add a configure-git action., Maxim Cournoyer, 2023/04/23
- bug#58813: [PATCH 3/5] teams: Add a configure-git action., Liliana Marie Prikler, 2023/04/23
- bug#58813: [PATCH 3/5] teams: Add a configure-git action., Maxim Cournoyer, 2023/04/23
- bug#58813: [PATCH v2 4/5] teams: Add a 'cc-mentors-header-cmd' action., Maxim Cournoyer, 2023/04/23
- bug#58813: [PATCH v2 1/5] gnu: git: Apply patch adding the --header-cmd feature., Maxim Cournoyer, 2023/04/23
- bug#58813: [PATCH v2 0/5] Fix teams.scm by use of a new --header-cmd git send-email option., Maxim Cournoyer, 2023/04/23
- bug#58813: [PATCH v2 2/5] teams: Add 'cc-members-header-cmd' action.,
Maxim Cournoyer <=
- bug#58813: [PATCH v2 3/5] Makefile.am: Auto-configure Git on 'make'., Maxim Cournoyer, 2023/04/23
- bug#58813: [PATCH v2 3/5] Makefile.am: Auto-configure Git on 'make'., Josselin Poiret, 2023/04/28
- bug#58813: [PATCH v2 5/5] doc: Simplify contributing section by automating git configuration., Maxim Cournoyer, 2023/04/23