Subject: Re: bug#63378: [PATCH] teams: Fix script to produce a single X-Debbugs-Cc header.

From: Arun Isaac <[email-masked]>
Date: Wed, 10 May 2023 00:55:45 +0100

Hi Maxim,

When a patch relates to no teams, I get the empty header output
"X-Debbugs-Cc: ". For such patches, it would be nicer to not add any
header instead of adding an empty header.

> +(define (team->members team)
> +  "Return the list of members in TEAM."
> +  (sort (team-members team)
> +        (lambda (m1 m2)
> +          (string<? (person-name m1) (person-name m2)))))
> +
> +(define (member->string member)
> +  "Return the 'email <name>' string representation of MEMBER."
> +  (format #false "~a <~a>" (person-name member) (person-email
> member)))

When person name contains a comma, it should be escaped by surrounding
in double quotes. Else, the comma would interfere with the
comma-separated list that we are constructing for
X-Debbugs-Cc. Admittedly, none of our current team members have commas
in their person names. But, some people like to have a name like
"LastName, FirstName". We should protect against that edge case in the
interest of futureproofing.

> +     (format #true "X-Debbugs-Cc: ~{~a~^,~}"
> +             (append-map (compose (cut map member->string <>)
> +                                  team->members
> +                                  find-team)
> +                         (patch->teams patch-file))))

A very nitpicky suggestion: Maybe, separate multiple persons by ", "
instead of just ",". ", " looks slightly better cosmetically. Likewise
in other places where this occurs.

Thanks for all the hard work! :-)

Regards,
Arun