sequencer: simplify adding Signed-off-by: trailer

Add the Signed-off-by: trailer in one place rather than adding it to the message when doing a recursive merge and specifying '--signoff' when running 'git commit'. This means that if there are conflicts when merging with a strategy other than 'recursive' the Signed-off-by: trailer will be added if the user commits the resolution themselves without passing '--signoff' to 'git commit'. It also simplifies the in-process commit that is about to be added to the sequencer. Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Phillip Wood committed Nov 24, 2017 at 11:07 UTC b34eeea352f15f93e98982a0e7970b0026053fb2
1 file changed +3 -5
sequencer.c
+3 -5
@@ -477,9 +477,6 @@ static int do_recursive_merge(struct commit *base, struct commit *next,
477 _(action_name(opts)));
478 rollback_lock_file(&index_lock);
479
480 - if (opts->signoff)
481 - append_signoff(msgbuf, 0, 0);
482 -
480 if (!clean)
481 append_conflicts_hint(msgbuf);
482
@@ -657,8 +654,6 @@ static int run_git_commit(const char *defmsg, struct replay_opts *opts,
654 argv_array_push(&cmd.args, "--amend");
655 if (opts->gpg_sign)
656 argv_array_pushf(&cmd.args, "-S%s", opts->gpg_sign);
660 - if (opts->signoff)
661 - argv_array_push(&cmd.args, "-s");
657 if (defmsg)
658 argv_array_pushl(&cmd.args, "-F", defmsg, NULL);
659 if ((flags & CLEANUP_MSG))
@@ -1347,6 +1342,9 @@ static int do_pick_commit(enum todo_command command, struct commit *commit,
1342 }
1343 }
1344
1345 + if (opts->signoff)
1346 + append_signoff(&msgbuf, 0, 0);
1347 +
1348 if (is_rebase_i(opts) && write_author_script(msg.message) < 0)
1349 res = -1;
1350 else if (!opts->strategy || !strcmp(opts->strategy, "recursive") || command == TODO_REVERT) {