git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git interpret-trailers with multiple keys

From
MTMichael S. Tsirkin <mst@redhat.com>
Date
Apr 6, 2016, 17:16 UTC
Message-ID
<20160406201509-mutt-send-email-mst@redhat.com>
In-Reply-To
<vpqlh4qbrnt.fsf@anie.imag.fr>
On Wed, Apr 06, 2016 at 06:58:30PM +0200, Matthieu Moy wrote:
Show 33 quoted lines
> "Michael S. Tsirkin" <mst@redhat.com> writes:
> 
> > I have this in .git/config
> >
> > [trailer "r"]
> >         key = Reviewed-by
> >         command = "echo \"Michael S. Tsirkin <mst@redhat.com\""
> > [trailer "s"]
> >         key = Signed-off-by
> >         command = "echo \"Michael S. Tsirkin <mst@redhat.com\""
> >
> > whenever I run git interpret-trailers -t r I see these lines added:
> >
> > Reviewed-by: Michael S. Tsirkin <mst@redhat.com
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com
> > Reviewed-by: Michael S. Tsirkin <mst@redhat.com
> >
> > Why is Reviewed-by repeated?  Bug or feature?
> 
> The first two lines are added unconditionally:
> 
> $ echo | git interpret-trailers 
> 
> Reviewed-by: Michael S. Tsirkin <mst@redhat.com
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com
> 
> 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)

Is this worth fixing? It doesn't look like a behaviour anyone would want...

> -- 
> Matthieu Moy
> http://www-verimag.imag.fr/~moy/
Previous: Matthieu MoyNext: Junio C Hamano
Message 3 of 12 in “git interpret-trailers with multiple keys”
  1. Michael S. TsirkinApr 6, 2016
  2. Matthieu MoyApr 6, 2016
  3. Michael S. TsirkinApr 6, 2016
  4. Junio C HamanoApr 6, 2016
  5. Michael S. TsirkinApr 6, 2016
  6. Christian CouderApr 7, 2016
  7. Michael S. TsirkinApr 10, 2016
  8. Christian CouderApr 10, 2016
  9. Michael S. TsirkinApr 10, 2016
  10. Michael S. TsirkinApr 10, 2016
  11. Matthieu MoyApr 11, 2016
  12. Michael S. TsirkinApr 11, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.