git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Robin Stocker <robin@nibor.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] cherry-pick: Append -x line on separate paragraph
Date: Tue, 04 Sep 2012 11:43:28 -0700	[thread overview]
Message-ID: <7vsjaxaasv.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <1244407605.1231.1346779006295.JavaMail.root@bazinga.schuettel.ch> (Robin Stocker's message of "Tue, 4 Sep 2012 19:16:46 +0200 (CEST)")

Robin Stocker <robin@nibor.org> writes:

>  		if (opts->record_origin) {
> +			/* Some implementations don't terminate message with final \n, so add it */
> +			if (msg.message[strlen(msg.message)-1] != '\n')
> +				strbuf_addch(&msgbuf, '\n');

I can agree that this is a good change.

> +			strbuf_addch(&msgbuf, '\n');

But this is somewhat dubious.  Even if what we are adding is merely
an extra LF, that changes the mechanically generated output format
and can break existing hooks that read from these generated commit
log template.

Is there a reason better than "having an empty line there look
better to _me_" to justify this change?

>  			strbuf_addstr(&msgbuf, "(cherry picked from commit ");
>  			strbuf_addstr(&msgbuf, sha1_to_hex(commit->object.sha1));
>  			strbuf_addstr(&msgbuf, ")\n");

Having said that, I've seen proposals to update this message to
format more like the other trailers, so that we would see this:

	The title of the original commit

	The log message taken from the original
        commit comes here.

	Signed-off-by: First person who signed off the original
        Signed-off-by: Another person who signed off the original
        Cherry-picked-from: a9bbc121ea850e49d52ba3cb5a6b7f8077d195d2
        
in the editor, to allow you to add your own Sign-off at the end to
make it look like this:

	The title of the original commit

	The log message taken from the original
        commit comes here.

	Signed-off-by: First person who signed off the original
        Signed-off-by: Another person who signed off the original
        Cherry-picked-from: a9bbc121ea850e49d52ba3cb5a6b7f8077d195d2
	Signed-off-by: Me who did the cherry-pick

I think that might be a worthwhile thing to do perhaps as an
optional behaviour (e.g. perhaps triggered with a new option
"--trailer", or with the same "-x" but only when "cherry-pick.origin
= trailer" configuration is set, or something).  At that point, the
output will look vastly different to existing hooks and those who
care how this field looks like are forced to be updated, but as long
as it is an opt-in feature, it may be worth it.

  reply	other threads:[~2012-09-04 18:43 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 [this message]
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

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=7vsjaxaasv.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --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).