git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Beat Bolli <bbolli@ewanet.ch>
To: git@vger.kernel.org
Cc: Beat Bolli <bbolli@ewanet.ch>, Eric Raible <raible@nextest.com>
Subject: [PATCH] cherry-pick -x: always insert an empty line
Date: Sat, 18 Feb 2012 22:14:50 +0100	[thread overview]
Message-ID: <1329599690-9152-1-git-send-email-bbolli@ewanet.ch> (raw)

When cherry-picking a commit that has only a summary, the -x option
creates an invalid commit message because it puts the hash of the commit
being picked on the second line which should be left empty.

This patch fixes this buglet by always inserting an empty line before
the added line.

Aside from that, even with a non-trivial commit the generated note
"(cherry picked from commit 555c9864971744abb558796aea28e12a1ac20839)"
seems abrupt when appended directly.

Cc: Eric Raible <raible@nextest.com>
Signed-off-by: Beat Bolli <bbolli@ewanet.ch>
---
 sequencer.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sequencer.c b/sequencer.c
index 5fcbcb8..63fd589 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -382,7 +382,7 @@ static int do_pick_commit(struct commit *commit, struct replay_opts *opts)
 		}
 
 		if (opts->record_origin) {
-			strbuf_addstr(&msgbuf, "(cherry picked from commit ");
+			strbuf_addstr(&msgbuf, "\n(cherry picked from commit ");
 			strbuf_addstr(&msgbuf, sha1_to_hex(commit->object.sha1));
 			strbuf_addstr(&msgbuf, ")\n");
 		}
-- 
1.7.9

             reply	other threads:[~2012-02-18 21:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-18 21:14 Beat Bolli [this message]
2012-02-19  8:44 ` [PATCH] cherry-pick -x: always insert an empty line Junio C Hamano
2012-02-23  8:39   ` Beat Bolli
2012-02-23  9:38   ` Sebastian Schuberth
2012-02-23  8:56 ` Sebastian Schuberth

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=1329599690-9152-1-git-send-email-bbolli@ewanet.ch \
    --to=bbolli@ewanet.ch \
    --cc=git@vger.kernel.org \
    --cc=raible@nextest.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).