From: Junio C Hamano Date: Tue, 16 May 2017 02:51:52 +0000 (+0900) Subject: Merge branch 'jt/use-trailer-api-in-commands' X-Git-Tag: v2.14.0-rc0~194 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/6ebfa10439e50175f24874b39c16fea6560adefe Merge branch 'jt/use-trailer-api-in-commands' "git cherry-pick" and other uses of the sequencer machinery mishandled a trailer block whose last line is an incomplete line. This has been fixed so that an additional sign-off etc. are added after completing the existing incomplete line. * jt/use-trailer-api-in-commands: sequencer: add newline before adding footers --- 6ebfa10439e50175f24874b39c16fea6560adefe diff --cc sequencer.c index 10c3b4ff81,5df080dada..0fa3fb14f7 --- a/sequencer.c +++ b/sequencer.c @@@ -1040,11 -688,17 +1040,12 @@@ static int do_pick_commit(enum todo_com next = commit; next_label = msg.label; - /* - * Append the commit log message to msgbuf; it starts - * after the tree, parent, author, committer - * information followed by "\n\n". - */ - p = strstr(msg.message, "\n\n"); - if (p) - strbuf_addstr(&msgbuf, skip_blank_lines(p + 2)); + /* Append the commit log message to msgbuf. */ + if (find_commit_subject(msg.message, &p)) + strbuf_addstr(&msgbuf, p); if (opts->record_origin) { + strbuf_complete_line(&msgbuf); if (!has_conforming_footer(&msgbuf, NULL, 0)) strbuf_addch(&msgbuf, '\n'); strbuf_addstr(&msgbuf, cherry_picked_prefix);