Subject: bug#58813: closed (Re: bug#58813: can't substitute etc/teams.scm command as doc suggests)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 01 May 2023 16:39:02 +0000

Your bug report

#58813: can't substitute etc/teams.scm command as doc suggests

which was filed against the guix package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
58813: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=58813
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#58813: can't substitute etc/teams.scm command as doc suggests
From: Maxim Cournoyer <[email-masked]>
To: Josselin Poiret <[email-masked]>
Cc: [email-masked], [email-masked], [email-masked], [email-masked]
Date: Mon, 01 May 2023 12:38:34 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

Josselin Poiret <[email-masked]> writes:

> Hi Maxim,
>
> Only seeing this patchset now, but it seems great!
>
> Maxim Cournoyer <[email-masked]> writes:
>
>> +[commit]
>> +        gpgsign = true
>> +
>>  [diff "scheme"]
>>  	xfuncname = "^(\\(define.*)$"
>>  
>>  [diff "texinfo"]
>>  	xfuncname = "^@node[[:space:]]+([^,]+).*$"
>> +
>> +[format]
>> +        useAutoBase = true
>> +        thread = shallow
>> +
>> +[pull]
>> +        rebase = true
>> +
>> +[sendemail]
>> +        to = [email-masked]
>> +        headerCmd = etc/teams.scm cc-members-header-cmd
>> +        thread = no
>
> Could we also consider adding format.forceinbodyfrom=true, so that
> contributors whose From: gets rewritten by debbugs/mailman still have
> the proper attribution without requiring manual action from committers?

Seems reasonable.  I've added it in, and have now pushed the series.
The upstream git commit hasn't been merged yet, but I've addressed all
their comments, and will continue doing so.

Closing, finally :-).  I'll push an associated news entry shortly.

-- 
Thanks,
Maxim

Subject: can't substitute etc/teams.scm command as doc suggests
From: Maxim Cournoyer <[email-masked]>
To: bug-guix <[email-masked]>
Date: Wed, 26 Oct 2022 23:50:14 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

Today, I tried;

--8<---------------cut here---------------start------------->8---
$ git send-email --to=[email-masked] \
  $(./etc/teams.scm cc-members origin/master HEAD) 0000-cover-letter.patch
fatal: ambiguous argument [email-masked]"': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
format-patch -o /tmp/pFSRbRNNoU --add-header="X-Debbugs-Cc: [email-masked]" --add-header="X-Debbugs-Cc: redacted@email" [...]: command returned error: 128

$ ./etc/teams.scm cc-members origin/master HEAD
--add-header="X-Debbugs-Cc: redacted@email" --add-header="X-Debbugs-Cc: redacted@email" ...
--8<---------------cut here---------------end--------------->8---

You can see the command fails; this is because when using Bash command
substitution $(), the quotes in the result are not interpreted and are
thus part of the value (literals), which then gets split on white space.

As a quick hacky fix,  I tried removing the space and double quotes
like:

modified   etc/teams.scm.in
@@ -514,7 +514,7 @@ (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?))))

and sent a patch with that command:

git send-email --to=[email-masked] \
  $(./etc/teams.scm cc-members origin/master HEAD 0000-cover-letter.patch

It created https://issues.guix.gnu.org/58812 with it, but I don't see
any of the X-Debbugs-Cc headers.  Mmmh.

-- 
Thanks,
Maxim