GNU bug report logs - #58660
[PATCH 0/4] Minor tweaks of etc/teams.scm

Previous Next

Package: guix-patches;

Reported by: zimoun <zimon.toutoune <at> gmail.com>

Date: Thu, 20 Oct 2022 13:23:02 UTC

Severity: normal

Tags: moreinfo, patch

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #41 received at 58660 <at> debbugs.gnu.org (full text, mbox):

From: zimoun <zimon.toutoune <at> gmail.com>
To: 58660 <at> debbugs.gnu.org
Cc: othacehe <at> gnu.org, zimoun <zimon.toutoune <at> gmail.com>
Subject: [PATCH v2 1/3] etc: teams: Add 'show' subcommand.
Date: Thu, 17 Nov 2022 21:28:18 +0100
* etc/teams.scm.in: Add 'show' subcommand.
---
 etc/teams.scm.in | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/etc/teams.scm.in b/etc/teams.scm.in
index c458b14e3b..e4e0dc209d 100644
--- a/etc/teams.scm.in
+++ b/etc/teams.scm.in
@@ -5,6 +5,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2022 Ricardo Wurmus <rekado <at> elephly.net>
 ;;; Copyright © 2022 Mathieu Othacehe <othacehe <at> gnu.org>
+;;; Copyright © 2022 Simon Tournier <zimon.toutoune <at> gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -538,7 +539,7 @@ (define port* (or port (current-output-port)))
     (team-members team)
     (lambda (m1 m2) (string<? (person-name m1) (person-name m2))))))
 
-(define (list-teams)
+(define* (list-teams #:optional team-names)
   "Print all teams, their scope and their members."
   (define port* (current-output-port))
   (define width* (%text-width))
@@ -564,11 +565,13 @@ (define width* (%text-width))
                (scope (format #f "scope: ~{~s ~}~%" scope))))
      (list-members team port* "+ ")
      (newline))
-   (sort
-    (hash-map->list (lambda (key value) value) %teams)
-    (lambda (team1 team2)
-      (string<? (symbol->string (team-id team1))
-                (symbol->string (team-id team2)))))))
+   (if team-names
+       (map find-team team-names)
+       (sort
+        (hash-map->list (lambda (key value) value) %teams)
+        (lambda (team1 team2)
+          (string<? (symbol->string (team-id team1))
+                    (symbol->string (team-id team2))))))))
 
 
 (define (diff-revisions rev-start rev-end)
@@ -611,6 +614,8 @@ (define (main . args)
       (lambda (team-name)
         (list-members (find-team team-name)))
       team-names))
+    (("show" . team-names)
+     (list-teams team-names))
     (anything
      (format (current-error-port)
              "Usage: etc/teams.scm <command> [<args>]
@@ -619,6 +624,7 @@ (define (main . args)
   cc <team-name>            get git send-email flags for cc-ing <team-name>
   cc-members <start> <end>  cc teams related to files changed between revisions
   list-teams                list teams and their members
-  list-members <team-name>  list members belonging to <team-name>~%"))))
+  list-members <team-name>  list members belonging to <team-name>
+  show <team-name>          display <team-name> properties~%"))))
 
 (apply main (cdr (command-line)))
-- 
2.38.1





This bug report was last modified 1 year and 349 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.