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

Re: [PATCH RFC] git-am: support any number of signatures

From
MTMichael S. Tsirkin <mst@redhat.com>
Date
Sep 23, 2014, 08:07 UTC
Message-ID
<20140923080700.GA16527@redhat.com>
In-Reply-To
<CAP8UFD2W1r9859FgpBXqvdNLAfXoCwjpEFpTKXU6fGuC_8uvBg@mail.gmail.com>
On Tue, Sep 23, 2014 at 09:45:50AM +0200, Christian Couder wrote:
Show 45 quoted lines
> Hi Michael,
> 
> On Mon, Sep 22, 2014 at 4:01 PM, Michael S. Tsirkin <mst@redhat.com> wrote:
> >
> > Hi Junio, Christian,
> > it's been a while.
> > I see that the work on trailers is going on.
> > I tried going over the documentation but I could not figure
> > out how would one implement multiple signatures using the
> > trailers mechanism.
> >
> > As a reminder, this old patchset (that I replied to) enhanced git am -s
> > with an option to add different signatures depending on
> > the option passed to the -s flag.
> > E.g. I have
> > [am "a"]
> >         signoff = "Acked-by: Michael S. Tsirkin <mst@redhat.com>"
> >
> > [am "r"]
> >         signoff = "Reviewed-by: Michael S. Tsirkin <mst@redhat.com>"
> >
> > [am "t"]
> >         signoff = "Tested-by: Michael S. Tsirkin <mst@redhat.com>"
> >
> > and now:
> >         git am -s art
> > adds all 3 signatures when applying the patch.
> 
> This is probably not as simple as you would like but it works with
> something like:
> 
> $ git interpret-trailers --trailer "Acked-by: Michael S. Tsirkin
> <mst@redhat.com>" --trailer "Reviewed-by: Michael S. Tsirkin
> <mst@redhat.com>"  --trailer "Tested-by: Michael S. Tsirkin
> <mst@redhat.com>" 0001-foo.patch >to_apply/0001-foo.patch
> 
> and then:
> 
> $ git am to_apply/*.patch
> 
> Also by using something like:
> 
> $ git config trailer.a.key Acked-by
> $ git config trailer.r.key Reviewed-by
> $ git config trailer.t.key Tested-by

I would like multiple keys to match a specific letter, e.g. as a maintainer I need both reviewed by and signed off by when I apply a patch, I like applying them with a single "-s m".

Show 22 quoted lines
> the first command could be simplified to:
> 
> $ git interpret-trailers --trailer "a: Michael S. Tsirkin
> <mst@redhat.com>" --trailer "r: Michael S. Tsirkin <mst@redhat.com>"
> --trailer "t: Michael S. Tsirkin <mst@redhat.com>" 0001-foo.patch
> >to_apply/0001-foo.patch
> 
> And if you use an env variable:
> 
> $ ME="Michael S. Tsirkin <mst@redhat.com>"
> $ git interpret-trailers --trailer "a: $ME" --trailer "r: $ME"
> --trailer "t: $ME" 0001-foo.patch >to_apply/0001-foo.patch
> 
> Maybe later we will integrate git interpret-trailers with git commit,
> git am and other commands, so that you can do directly:
> 
> git am --trailer "a: $ME" --trailer "r: $ME"  --trailer "t: $ME" 0001-foo.patch
> 
> Maybe we wil also assign a one letter shortcut to --trailer, for
> example "z", so that could be:
> 
> git am -z "a: $ME" -z "r: $ME"  -z "t: $ME" 0001-foo.patch

-s could apply here, right? It doesn't have a parameter at the moment.

> We could also allow many separators in the same -z argument as long as
> they are separated by say "~",
I think -z a -z r -z t is enough.
Show 10 quoted lines
> so you could have:
> 
> git am -z "a: $ME~r: $ME~t: $ME" 0001-foo.patch
> 
> And then we could also allow people to define default values for
> trailers with something like:
> 
> $ git config trailer.a.defaultvalue "Michael S. Tsirkin <mst@redhat.com>"
> $ git config trailer.r.defaultvalue "Michael S. Tsirkin <mst@redhat.com>"
> $ git config trailer.t.defaultvalue "Michael S. Tsirkin <mst@redhat.com>"

I'm kind of confused by the key/value concept. Can't I define the whole 'Acked-by: Michael S. Tsirkin <mst@redhat.com>' string as the key?

Show 8 quoted lines
> So that in the end you could have:
> 
> git am -z a~r~t 0001-foo.patch
> 
> which is very close to "git am -s art".
> 
> Best,
> Christian.

If I figure out the defaultvalue thing, I might find the time to work on git am integration.

Previous: Christian CouderNext: Christian Couder
Message 15 of 31 in “git-am: support any number of signatures”
  1. git-am: support any number of signaturesMichael S. Tsirkin, Jun 12, 2014
  2. Junio C HamanoJun 12, 2014
  3. Michael S. TsirkinJun 13, 2014
  4. Junio C HamanoJun 13, 2014
  5. Michael S. TsirkinJun 15, 2014
  6. Junio C HamanoJun 16, 2014
  7. Michael S. TsirkinJun 18, 2014
  8. Junio C HamanoJun 18, 2014
  9. Michael S. TsirkinJun 18, 2014
  10. Junio C HamanoJun 18, 2014
  11. Michael S. TsirkinJun 18, 2014
  12. Michael S. TsirkinSep 22, 2014
  13. Junio C HamanoSep 22, 2014
  14. Christian CouderSep 23, 2014
  15. Michael S. TsirkinSep 23, 2014
  16. Christian CouderSep 24, 2014
  17. Michael S. TsirkinOct 7, 2014
  18. Junio C HamanoSep 23, 2014
  19. Junio C HamanoSep 25, 2014
  20. Christian CouderSep 25, 2014
  21. Junio C HamanoSep 25, 2014
  22. Christian CouderSep 28, 2014
  23. Michael S. TsirkinOct 7, 2014
  24. Jeff KingOct 7, 2014
  25. Junio C HamanoOct 7, 2014
  26. René ScharfeJun 12, 2014
  27. Michael S. TsirkinJun 13, 2014
  28. Christian CouderOct 12, 2014
  29. Christian CouderOct 13, 2014
  30. Junio C HamanoOct 13, 2014
  31. Christian CouderOct 14, 2014

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.