From: "Michael S. Tsirkin" <mst@redhat.com>
To: Christian Couder <christian.couder@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
Git Mailing List <git@vger.kernel.org>,
Christian Couder <chriscool@tuxfamily.org>
Subject: Re: [PATCH RFC] git-am: support any number of signatures
Date: Wed, 8 Oct 2014 00:33:29 +0300 [thread overview]
Message-ID: <20141007213329.GB14632@redhat.com> (raw)
In-Reply-To: <CAP8UFD2FV2pvR4+N0fDLtentA_oWwYGRZ6rPtshi=TOAvXaRLA@mail.gmail.com>
On Wed, Sep 24, 2014 at 12:00:40PM +0200, Christian Couder wrote:
> On Tue, Sep 23, 2014 at 10:07 AM, Michael S. Tsirkin <mst@redhat.com> wrote:
> > On Tue, Sep 23, 2014 at 09:45:50AM +0200, Christian Couder wrote:
> >> 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".
>
> That's different from what you implemented in your patch.
> And franckly I think that for this kind of specific use cases, you
> could create your own aliases, either Git aliases or just shell
> aliases.
>
> For example if we implement default values and make git am call git
> interpret-trailers, a shell alias could simply be:
>
> alias gamsm='git am --trailer r --trailer s'
>
> I use "git log --oneline --decorate --graph" very often, so I made my
> own alias for it, and I suppose a lot of other people have done so.
>
> The number of people who will use trailers will probably be much
> smaller than the number of people using git log, so if we don't make
> shortcuts for "git log --oneline --decorate --graph", I see no ground
> to ask for a specific shortcut that adds both a reviewed by and a
> signed off by.
I've been thinking: how about a generic ability to add option shortcuts
for commands in .config?
For example:
[am "-z"]
command = "--trailer foobar"
would replace any -z in git am command line with --trailer foobar.
Does this sound useful?
> >> 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?
>
> I don't know what we will do with -s. Maybe if we use -z, we don't need -s.
>
> > It doesn't have a parameter at the moment.
>
> We will have to discuss that kind of thing when we make it possible
> for git commit, git am and maybe other commands to accept trailers
> arguments and pass them to git interpret-trailers.
>
> In his email Junio seems to say that we don't need a shortcut like -z,
> we could only have --trailer.
> And I think that it is indeed sound to at least wait a little before
> using up one shortcut like -z in many commands.
>
> >> 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.
>
> Great! I think you will likely have at least "--trailer a --trailer r
> --trailer t", but I don't think it is too bad as you can use aliases
> to make it shorter to type.
>
> >> 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.
>
> A "defaultvalue" would be the value used when no value is passed.
> The "key" is just what we will use in the first part of the trailer
> (the part before the separator).
>
> For example with the above "defaultvalue" and "key", "--trailer a:
> Junio <gitster@pobox.com>" would add:
>
> Acked-by: Junio <gitster@pobox.com>
>
> while "--trailer a" would add:
>
> Acked-by: Michael S. Tsirkin <mst@redhat.com>
>
> > Can't I define the whole 'Acked-by: Michael S. Tsirkin <mst@redhat.com>'
> > string as the key?
>
> The whole 'Acked-by: Michael S. Tsirkin <mst@redhat.com>' is a full
> trailer, not a "key".
>
> And it is not possible right now to define a full trailer. Maybe we
> could find a way to make it possible, but a default value and a way to
> have a small nickname for the token (like "a" for "Acked-by") should
> get people quite far. And then for very specific use cases, it may be
> better to use aliases anyway.
>
> >> 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".
> >
> > If I figure out the defaultvalue thing, I might
> > find the time to work on git am integration.
>
> That would be great!
>
> Thanks,
> Christian.
next prev parent reply other threads:[~2014-10-07 21:30 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-12 16:12 [PATCH RFC] git-am: support any number of signatures Michael S. Tsirkin
2014-06-12 19:07 ` Junio C Hamano
2014-06-13 8:00 ` Michael S. Tsirkin
2014-06-13 17:32 ` Junio C Hamano
2014-06-15 10:27 ` Michael S. Tsirkin
2014-06-16 18:06 ` Junio C Hamano
2014-06-18 3:09 ` Michael S. Tsirkin
2014-06-18 6:49 ` Junio C Hamano
2014-06-18 7:33 ` Michael S. Tsirkin
2014-06-18 17:51 ` Junio C Hamano
2014-06-18 18:23 ` Michael S. Tsirkin
2014-09-22 14:01 ` Michael S. Tsirkin
2014-09-22 17:58 ` Junio C Hamano
2014-09-23 7:45 ` Christian Couder
2014-09-23 8:07 ` Michael S. Tsirkin
2014-09-24 10:00 ` Christian Couder
2014-10-07 21:33 ` Michael S. Tsirkin [this message]
2014-09-23 17:15 ` Junio C Hamano
2014-09-25 5:04 ` Junio C Hamano
2014-09-25 10:04 ` Christian Couder
2014-09-25 16:20 ` Junio C Hamano
2014-09-28 11:36 ` Christian Couder
[not found] ` <7viok7k0c0.fsf@alter.siamese.dyndns.org>
2014-10-12 9:36 ` Christian Couder
2014-10-13 5:09 ` Christian Couder
2014-10-13 22:05 ` Junio C Hamano
2014-10-14 5:29 ` Christian Couder
2014-10-07 21:29 ` Michael S. Tsirkin
2014-10-07 21:39 ` Jeff King
2014-10-07 21:41 ` Junio C Hamano
2014-06-12 19:25 ` René Scharfe
2014-06-13 8:01 ` Michael S. Tsirkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141007213329.GB14632@redhat.com \
--to=mst@redhat.com \
--cc=chriscool@tuxfamily.org \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).