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

Re: More builtin git-am issues..

From
Jeff King <peff@peff.net>
Date
Sep 5, 2015, 08:03 UTC
Message-ID
<20150905080325.GA25039@sigill.intra.peff.net>
In-Reply-To
<55EA9A13.2050108@kdbg.org>
On Sat, Sep 05, 2015 at 09:30:27AM +0200, Johannes Sixt wrote:
Show 11 quoted lines
> >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".
Previous: Johannes SixtNext: Junio C Hamano
Message 11 of 30 in “More builtin git-am issues..”
  1. Linus TorvaldsSep 4, 2015
  2. Linus TorvaldsSep 4, 2015
  3. Jeff KingSep 5, 2015
  4. Linus TorvaldsSep 5, 2015
  5. Junio C HamanoSep 5, 2015
  6. Linus TorvaldsSep 5, 2015
  7. Junio C HamanoSep 5, 2015
  8. Linus TorvaldsSep 5, 2015
  9. Junio C HamanoSep 5, 2015
  10. Johannes SixtSep 5, 2015
  11. Jeff KingSep 5, 2015
  12. Junio C HamanoSep 5, 2015
  13. Junio C HamanoSep 5, 2015
  14. Junio C HamanoSep 5, 2015
  15. Junio C HamanoSep 5, 2015
  16. Christian CouderSep 7, 2015
  17. Junio C HamanoSep 5, 2015
  18. Junio C HamanoSep 5, 2015
  19. Junio C HamanoSep 5, 2015
  20. Linus TorvaldsSep 5, 2015
  21. Junio C HamanoSep 5, 2015
  22. am: match --signoff to the original scripted versionJunio C Hamano, Sep 6, 2015
  23. Paul TanSep 6, 2015
  24. Junio C HamanoSep 6, 2015
  25. Jeff KingSep 8, 2015
  26. Paul TanSep 6, 2015
  27. Junio C HamanoSep 6, 2015
  28. Linus TorvaldsSep 6, 2015
  29. Jeff KingSep 8, 2015
  30. Junio C HamanoSep 8, 2015

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.