Subject: [bug#60218] [PATCH 1/2] teams: Add a "get-maintainer" command.

From: Ricardo Wurmus <[email-masked]>
Date: Sun, 25 Dec 2022 00:15:39 +0100

Hi Maxim,

> This can be used as a compatibility mode with the get_maintainer.pl Perl
> script included in the Linux (or U-Boot) source tree.
>
> * etc/teams.scm.in (git-patch->commit-id): New procedure.
> (main) <get-maintainer>: Register new command.  Document it.

Interesting.

> @@ -616,6 +627,14 @@ (define (main . args)
>      (("cc-members" rev-start rev-end)
>       (apply cc (find-team-by-scope
>                  (diff-revisions rev-start rev-end))))
> +    (("get-maintainer" patch-file)
> +     (let* ((rev-end (git-patch->commit-id patch-file))
> +            (rev-start (string-append rev-end "^")))

This is to get the changes introduced by this patch-file right?  In a
format that allows you to use “diff-revisions” below, which you need to
run find-team-by-scope.

> +       (apply main "list-members"
> +              (map symbol->string
> +                   (map team-id
> +                        (find-team-by-scope
> +                         (diff-revisions rev-start rev-end)))))))

Here I’d do

    (map (compose symbol->string team-id) …)

instead of mapping twice.

I haven’t used get_maintainer.pl before, but I don’t object to this
change if it’s useful to you.

-- 
Ricardo