From: Jeff King <peff@peff.net>
To: Robin Stocker <robin@nibor.org>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH] cherry-pick: Append -x line on separate paragraph
Date: Mon, 10 Sep 2012 12:27:54 -0400 [thread overview]
Message-ID: <20120910162754.GD9435@sigill.intra.peff.net> (raw)
In-Reply-To: <1498324622.1357.1347113459304.JavaMail.root@bazinga.schuettel.ch>
On Sat, Sep 08, 2012 at 04:10:59PM +0200, Robin Stocker wrote:
> > > Maybe the solution is to detect if the original commit message
> > > ends with a trailer and in that case keep the existing behavior
> > > of not inserting a blank line?
> >
> > Yeah, that sounds like a good change from "this makes the result
> > look better" point of view.
>
> How do you think we could best detect a tailer? Check if all
> lines of the last paragraph start with /[\w-]+: /?
There is ends_rfc2822_footer() in builtin/commit.c, which is currently
used for adding Signed-off-by lines. It might make sense to factor that
out, and have a new:
add_pseudoheader(struct strbuf *commit_message,
const char *header)
that would implement the same set of spacing rules for signed-off-by,
cherry-picked-from, and anything else we end up adding later.
I think pseudo-headers like these might also want duplicate suppression
of the final line, which could be part of that function. Note that you
would not want to suppress a duplicate line from the middle of the
trailer, since you might want to sign-off twice (e.g., you sign-off the
original, and then also the cherry-pick). But you would not want two
duplicate lines at the end saying "Signed-off-by: ...", and I believe
"git commit" already suppresses those duplicates.
> I'm going to work on this and submit a new version of the patch. The
> "Cherry-picked-from" change could then be made later on top of that.
Yay. This has come up more than once over the years, so I am glad to see
somebody working on it.
-Peff
prev parent reply other threads:[~2012-09-10 16:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <739367481.1229.1346778500787.JavaMail.root@bazinga.schuettel.ch>
2012-09-04 17:16 ` [PATCH] cherry-pick: Append -x line on separate paragraph Robin Stocker
2012-09-04 18:43 ` Junio C Hamano
2012-09-05 20:36 ` Robin Stocker
2012-09-06 3:47 ` Junio C Hamano
2012-09-08 14:10 ` Robin Stocker
2012-09-10 16:27 ` Jeff King [this message]
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=20120910162754.GD9435@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=robin@nibor.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).