Skip to content

Commit b34eeea

Browse files
phillipwoodgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e47c6ca commit b34eeea

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

sequencer.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -477,9 +477,6 @@ static int do_recursive_merge(struct commit *base, struct commit *next,
477477
_(action_name(opts)));
478478
rollback_lock_file(&index_lock);
479479

480-
if (opts->signoff)
481-
append_signoff(msgbuf, 0, 0);
482-
483480
if (!clean)
484481
append_conflicts_hint(msgbuf);
485482

@@ -657,8 +654,6 @@ static int run_git_commit(const char *defmsg, struct replay_opts *opts,
657654
argv_array_push(&cmd.args, "--amend");
658655
if (opts->gpg_sign)
659656
argv_array_pushf(&cmd.args, "-S%s", opts->gpg_sign);
660-
if (opts->signoff)
661-
argv_array_push(&cmd.args, "-s");
662657
if (defmsg)
663658
argv_array_pushl(&cmd.args, "-F", defmsg, NULL);
664659
if ((flags & CLEANUP_MSG))
@@ -1347,6 +1342,9 @@ static int do_pick_commit(enum todo_command command, struct commit *commit,
13471342
}
13481343
}
13491344

1345+
if (opts->signoff)
1346+
append_signoff(&msgbuf, 0, 0);
1347+
13501348
if (is_rebase_i(opts) && write_author_script(msg.message) < 0)
13511349
res = -1;
13521350
else if (!opts->strategy || !strcmp(opts->strategy, "recursive") || command == TODO_REVERT) {

0 commit comments

Comments
 (0)