ctx.reflog_info = opt->reflog_info;
ctx.fmt = opt->commit_format;
pretty_print_commit(&ctx, commit, &msgbuf);
+
+ if (opt->add_signoff)
+ append_signoff(&msgbuf, opt->add_signoff);
+
if ((ctx.fmt != CMIT_FMT_USERFORMAT) &&
ctx.notes_message && *ctx.notes_message)
strbuf_addstr(&msgbuf, ctx.notes_message);
- if (opt->add_signoff)
- append_signoff(&msgbuf, opt->add_signoff);
if (opt->show_log_size) {
printf("log size %i\n", (int)msgbuf.len);
graph_show_oneline(opt->graph);
'
test_expect_success 'format-patch --signoff' '
- git format-patch -1 --signoff --stdout |
- grep "^Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>"
+ git format-patch -1 --signoff --stdout >out &&
+ grep "^Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>" out
+'
+
+test_expect_success 'format-patch --notes --signoff' '
+ git notes --ref test add -m "test message" HEAD &&
+ git format-patch -1 --signoff --stdout --notes=test >out &&
+ # Notes message must come after S-o-b
+ ! sed "/^Signed-off-by: /q" out | grep "test message" &&
+ sed "1,/^Signed-off-by: /d" out | grep "test message"
'
echo "fatal: --name-only does not make sense" > expect.name-only