From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id qO/uBcM/WWTEdQEASxT56A (envelope-from ) for ; Mon, 08 May 2023 20:30:27 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id CDclBcM/WWRWJwAAG6o9tA (envelope-from ) for ; Mon, 08 May 2023 20:30:27 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 83E463E25E for ; Mon, 8 May 2023 20:30:26 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pw5cg-0008Hg-9J; Mon, 08 May 2023 14:30:10 -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 1pw5ca-0008HL-NL for bug-guix@gnu.org; Mon, 08 May 2023 14:30:05 -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 1pw5ca-0007kr-BA for bug-guix@gnu.org; Mon, 08 May 2023 14:30:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pw5cY-0000CM-LD; Mon, 08 May 2023 14:30:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#63378: [PATCH] teams: Fix script to produce a single X-Debbugs-Cc header. References: <875y92vj2j.fsf@gmail.com> In-Reply-To: <875y92vj2j.fsf@gmail.com> Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: rekado@elephly.net, arunisaac@systemreboot.net, bug-guix@gnu.org Resent-Date: Mon, 08 May 2023 18:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63378 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 63378@debbugs.gnu.org Cc: Maxim Cournoyer , rekado@elephly.net, arunisaac@systemreboot.net X-Debbugs-Original-Xcc: rekado@elephly.net,arunisaac@systemreboot.net Received: via spool by 63378-submit@debbugs.gnu.org id=B63378.1683570599729 (code B ref 63378); Mon, 08 May 2023 18:30:02 +0000 Received: (at 63378) by debbugs.gnu.org; 8 May 2023 18:29:59 +0000 Received: from localhost ([127.0.0.1]:41546 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pw5cU-0000Bg-PI for submit@debbugs.gnu.org; Mon, 08 May 2023 14:29:59 -0400 Received: from mail-qk1-f178.google.com ([209.85.222.178]:62729) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pw5cS-0000BE-R8 for 63378@debbugs.gnu.org; Mon, 08 May 2023 14:29:57 -0400 Received: by mail-qk1-f178.google.com with SMTP id af79cd13be357-75131c2997bso1903016885a.1 for <63378@debbugs.gnu.org>; Mon, 08 May 2023 11:29:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683570591; x=1686162591; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=037XXBE+XidEDqfZA0Gx0RipFLHnrJfhFImxx1MOfsQ=; b=RIDvyzHqHDZWfIdk18eKVJzSbfUEt/RRh4GMIA74pY+WFz0yDhtqdUegho1pTFN3VO FCn61YZsNJiWJyJpVhaENtNYZpIcrKkLWPxbLxoTNa/bfkHrU6AEIv/DoPaEwPANt0s4 HZtcds7fK72vo/pl8dJrZ9NJjW3DqiseFoDB9+BEDBjmc9K+t2XhLG+aAiU7HkwSRb+/ fIn/ugFsK0A+8u6jFrcrcgsgU5SYFw4pX+i9FjmXlG5m0J1888wYxSYLiu+BqM077sIq 6YWM87Oahg/XMetEPAOOLWOgVvAZ7lm5+MGPUtiTWtp0rgwsm2yRC0IBZsn6yNMNarQf QU2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683570591; x=1686162591; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=037XXBE+XidEDqfZA0Gx0RipFLHnrJfhFImxx1MOfsQ=; b=UCZ5qAv85SeQrpBwIfz2vF64rjvQ9m+mTUWZiEUFvpxcrbPyi4YKNDM6YYuiYT2NM+ 6wESfWNkMgiCL8STG+M/IuA75vXBQVMF5XDH+HLje1uCR0AHnVqr0QlQQqk+qLmroBsm 3oe5kmVR1Ea8IbfWpPCccrrzrkiDelXEjPY+ZxGvisJ4gZYZOvatgp5xPFWghJYQ532G IMtwvMvSvBJ3U+muR1j0mZT5CX8hi6Ij8DmysC71ILyH/i3mD6faf3xrznRHD4YqZQYV cnvdkzuH3D9GiVPi0WNtphKglVRwRd7TKcd8IsaVgPD/5wVgZxv7UNwKiBvpAgjDIy2W CxSQ== X-Gm-Message-State: AC+VfDxodvvoQJvw9fV3iILv23FZVfrMle5eWDocEvg6t1/114eJtW8m 1oi8o0ALJeoTfhIjbIe6Y9UCAFf5gd0lCA== X-Google-Smtp-Source: ACHHUZ4oeH9iQPV+pANeKRTi7qFT6KJU5dUBEK/slQqiiwrZSk5UpQll9d2q9qjjcRgOEEI+7WuUvA== X-Received: by 2002:ac8:5b88:0:b0:3ef:54c9:16d9 with SMTP id a8-20020ac85b88000000b003ef54c916d9mr26335490qta.28.1683570590981; Mon, 08 May 2023 11:29:50 -0700 (PDT) Received: from localhost.localdomain (dsl-10-131-119.b2b2c.ca. [72.10.131.119]) by smtp.gmail.com with ESMTPSA id b27-20020a05620a127b00b007571fbb5ee1sm311525qkl.30.2023.05.08.11.29.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 May 2023 11:29:50 -0700 (PDT) From: Maxim Cournoyer Date: Mon, 8 May 2023 14:29:42 -0400 Message-Id: <3e14e27ad26ce9dee230733c7e77935b5f43599d.1683570582.git.maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Seal: i=1; s=key1; d=yhetil.org; t=1683570626; a=rsa-sha256; cv=none; b=T525WChrkS+0b+asWEAgecVt1YtrqZbbIiU23ATZuGVcekgi2affGhKv/TSz9fysPoQsxL hjjGdXcYJisCukl3a8nej5h+vZIEE+WHN84+2SbfCjjc8+1Fmb/5RjUPN5dd5FxHhUZ93s Typb7cBUaI4MNt3GWISXT3Aj34c7myCu9rtbsPt5E53qdcP4ecaD0KDxuHUuhzp8w21Elo atDHQz62Lopagip8twY7VCKrUuQpovyu6xG7buXB+q/xPThaCcK4kl/qXS252UJUTzwloX VxEy5PMhfURddZYWhv8YoY1BeN0UzfkbCbgC8BlKabt1YPjv7iE6e+hD+d/7tg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=RIDvyzHq; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1683570626; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=037XXBE+XidEDqfZA0Gx0RipFLHnrJfhFImxx1MOfsQ=; b=b3Q9zfnGluqnlCqbLQkB9p8kCHUypTWf+jX73jL/o4IiPDSStNgRuZpdcTHvSMEv3ZgmTK J1Kp0eZFdRLA52qNlruuSEg+eBdWdxfECl4RiPr6tLRGTqzZjz+C66DwrK3HCLKaAl2UW/ A3PUjXxeOWEmHcc9EudNo9cPu+F9JET08B2pDN9DAisa5cc4pm4hPyPL4x1hLn5x7UvMDd oY7+5e4eAs0j4DNnomVDvk/2imZ9lwbvOgMD3Du+SEY5LlNcK4GoaVEkk956AeFy2N56MH v1iTAg8dO9nLU0i23epHfuioVr62nsssW3AWuha47QxJPhBEDCpUW537b9yQOw== X-Migadu-Spam: Yes X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=RIDvyzHq; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Spam: Yes X-Migadu-Spam-Score: 9.31 X-Spam-Score: 9.31 X-Migadu-Queue-Id: 83E463E25E X-TUID: Ut09BLd6HePi Fixes . * etc/teams.scm.in (cc): Adjust format pattern. (team->members, member->string): New procedures. (list-members): Refactor in terms of the above procedures. (main): Adjust the output of the 'cc-members-header-cmd' and 'cc-mentors-header-cmd' actions. --- etc/teams.scm.in | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/etc/teams.scm.in b/etc/teams.scm.in index dec175f630..50bfbca22e 100644 --- a/etc/teams.scm.in +++ b/etc/teams.scm.in @@ -605,23 +605,27 @@ (define (cc . teams) "Return arguments for `git send-email' to notify the members of the given TEAMS when a patch is received by Debbugs." (format #true - "~{--add-header=\"X-Debbugs-Cc: ~a\"~^ ~}" + "--add-header=\"X-Debbugs-Cc: ~{~a~^,~}\"" (map person-email (delete-duplicates (append-map team-members teams) equal?)))) +(define (team->members team) + "Return the list of members in TEAM." + (sort (team-members team) + (lambda (m1 m2) + (stringstring member) + "Return the 'email ' string representation of MEMBER." + (format #false "~a <~a>" (person-name member) (person-email member))) + (define* (list-members team #:optional port (prefix "")) "Print the members of the given TEAM." (define port* (or port (current-output-port))) (for-each (lambda (member) - (format port* - "~a~a <~a>~%" - prefix - (person-name member) - (person-email member))) - (sort - (team-members team) - (lambda (m1 m2) (stringstring member))) + (team->members team))) (define (list-teams) "Print all teams, their scope and their members." @@ -715,13 +719,14 @@ (define (main . args) (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))) + (format #true "X-Debbugs-Cc: ~{~a~^,~}" + (append-map (compose (cut map member->string <>) + team->members + find-team) + (patch->teams patch-file)))) (("cc-mentors-header-cmd" patch-file) - (list-members (find-team "mentors") (current-output-port) - "X-Debbugs-Cc: ")) + (format #true "X-Debbugs-Cc: ~{~a~^,~}" + (map member->string (team->members (find-team "mentors"))))) (("get-maintainer" patch-file) (apply main "list-members" (patch->teams patch-file))) (("list-teams" . args) base-commit: 4228d3c358669f5d15f01d3ba466f3356ecb6546 -- 2.39.2