git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Johannes Sixt <j6t@kdbg.org>
Cc: Junio C Hamano <gitster@pobox.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Paul Tan <pyokagan@gmail.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: More builtin git-am issues..
Date: Sat, 5 Sep 2015 04:03:26 -0400	[thread overview]
Message-ID: <20150905080325.GA25039@sigill.intra.peff.net> (raw)
In-Reply-To: <55EA9A13.2050108@kdbg.org>

On Sat, Sep 05, 2015 at 09:30:27AM +0200, Johannes Sixt wrote:

> >How about a bit looser rule like this?
> >
> >     A block of text at the end of the message, each and every
> >     line in which must match "^[^: 	]+:[      ]" (that is,
> >     a "keyword" that does not contain a whitespace nor a colon,
> >     followed by a colon and whitespace, and arbitrary value thru
> >     the end of line) is a signature block.
> 
> Why do we need a new rule? The old git-am had a logic that pleased everyone,
> and it must have been implemented somewhere. Shouldn't it be sufficient to
> just re-implement or re-use that logic?

That was my thought, too; if there is a regression, let's start by
fixing that for the upcoming 2.6.0, and then we can worry about doing
something fancier[1] later.

And I think the original behavior really is what Linus is asking for: we
consider the final block, even with a "[]" comment, as a S-o-b block if
it has a Signed-off-by in it. So if we have the final block:

    [some comment]
    Signed-off-by: Somebody Else <them@example.com>

Running "am -s" with the current master yields:

    [some comment]
    Signed-off-by: Somebody Else <them@example.com>

    Signed-off-by: Jeff King <peff@peff.net>

which is wrong. Running the same with v2.5.0 gets:

    [some comment]
    Signed-off-by: Somebody Else <them@example.com>
    Signed-off-by: Jeff King <peff@peff.net>

So far so good. Now let's change our input to:

    [some comment]
    Reviewed-by: Somebody Else <them@example.com>

and run "am -s".  Current "master" continues to stick the extra line in
there. No surprise. But now so does v2.5.0!

So I don't think the old behavior covered all cases well, either, and
there's room for improvement. But likewise, I don't recall seeing a lot
of complaints about it in practice. It seems like a sane thing to
restore it for the upcoming release, and then build from there.

-Peff

[1] I think part of the reason people are interested in "fancy" here is
    that this topic extends beyond "git am". There's "commit -s", of
    course, but there's also the generic "interpret-trailers" command,
    which is supposed to be a generalization of the "--signoff" option.
    It would be nice if the rules remained consistent for when we add a
    trailer to an existing block, rather than special-casing signoffs.

    But again, I think that's something to shoot for in the long run.
    It's more important in the short term not to regress "am".

  reply	other threads:[~2015-09-05  8:03 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-04 23:47 More builtin git-am issues Linus Torvalds
2015-09-04 23:52 ` Linus Torvalds
2015-09-05  0:07   ` Jeff King
2015-09-05  0:36     ` Linus Torvalds
2015-09-05  0:54   ` Junio C Hamano
2015-09-05  1:06     ` Linus Torvalds
2015-09-05  1:23       ` Junio C Hamano
2015-09-05  1:35         ` Linus Torvalds
2015-09-05 16:01           ` Junio C Hamano
2015-09-05  7:30     ` Johannes Sixt
2015-09-05  8:03       ` Jeff King [this message]
2015-09-05 16:10         ` Junio C Hamano
2015-09-05 16:32           ` Junio C Hamano
2015-09-05 16:57             ` Junio C Hamano
2015-09-05 19:39           ` Junio C Hamano
2015-09-07 19:27             ` Christian Couder
2015-09-05 15:24       ` Junio C Hamano
2015-09-05 15:34         ` Junio C Hamano
2015-09-05  1:06 ` Junio C Hamano
2015-09-05  1:20   ` Linus Torvalds
2015-09-05  1:24     ` Junio C Hamano
2015-09-06  4:56 ` [PATCH] am: match --signoff to the original scripted version Junio C Hamano
2015-09-06  9:04   ` Paul Tan
2015-09-06 17:24     ` Junio C Hamano
2015-09-08  6:18       ` Jeff King
2015-09-06 14:21   ` Paul Tan
2015-09-06 17:39     ` Junio C Hamano
2015-09-06 16:16   ` Linus Torvalds
2015-09-08  6:25   ` Jeff King
2015-09-08 18:14     ` Junio C Hamano

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=20150905080325.GA25039@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j6t@kdbg.org \
    --cc=pyokagan@gmail.com \
    --cc=torvalds@linux-foundation.org \
    /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).