Subject: Re: git interpret-trailers with multiple keys

From: Matthieu Moy <[email-masked]>
Date: Wed, 06 Apr 2016 18:58:30 +0200

"Michael S. Tsirkin" <[email-masked]> writes:

> I have this in .git/config
>
> [trailer "r"]
>         key = Reviewed-by
>         command = "echo \"Michael S. Tsirkin <[email-masked]\""
> [trailer "s"]
>         key = Signed-off-by
>         command = "echo \"Michael S. Tsirkin <[email-masked]\""
>
> whenever I run git interpret-trailers -t r I see these lines added:
>
> Reviewed-by: Michael S. Tsirkin <[email-masked]
> Signed-off-by: Michael S. Tsirkin <[email-masked]
> Reviewed-by: Michael S. Tsirkin <[email-masked]
>
> Why is Reviewed-by repeated?  Bug or feature?

The first two lines are added unconditionally:

$ echo | git interpret-trailers 

Reviewed-by: Michael S. Tsirkin <[email-masked]
Signed-off-by: Michael S. Tsirkin <[email-masked]

The last line is added because you've asked for it with --trailer r.

I don't think it's currently possible to get the behavior you seem to
expect, ie. to define trailer tokens fully (key and value) in your
config file but use them only on request.

(BTW, I think you wanted a closing > at the end)

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/