diff options
author | Phillip Wood <phillip.wood@dunelm.org.uk> | 2018-03-20 11:10:55 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-03-29 18:09:03 (GMT) |
commit | a852ec7f273cf61296a80ddfc26c23acf2163f2f (patch) | |
tree | 6abd2e0b2cb0e5b1de53c303950d4c661d341921 /sequencer.c | |
parent | 56173d28a5fb811c9525a8d5052ab6d83a07122e (diff) | |
download | git-a852ec7f273cf61296a80ddfc26c23acf2163f2f.zip git-a852ec7f273cf61296a80ddfc26c23acf2163f2f.tar.gz git-a852ec7f273cf61296a80ddfc26c23acf2163f2f.tar.bz2 |
rebase: extend --signoff support
Allow --signoff to be used with --interactive and --merge. In
interactive mode only commits marked to be picked, edited or reworded
will be signed off.
The main motivation for this patch was to allow one to run 'git rebase
--exec "make check" --signoff' which is useful when preparing a patch
series for publication and is more convenient than doing the signoff
with another --exec command.
This change also allows --root without --onto to work with --signoff
as well (--root with --onto was already supported).
Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sequencer.c')
-rw-r--r-- | sequencer.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sequencer.c b/sequencer.c index 45aa7e3..4aeaef2 100644 --- a/sequencer.c +++ b/sequencer.c @@ -127,6 +127,7 @@ static GIT_PATH_FUNC(rebase_path_rewritten_pending, static GIT_PATH_FUNC(rebase_path_gpg_sign_opt, "rebase-merge/gpg_sign_opt") static GIT_PATH_FUNC(rebase_path_orig_head, "rebase-merge/orig-head") static GIT_PATH_FUNC(rebase_path_verbose, "rebase-merge/verbose") +static GIT_PATH_FUNC(rebase_path_signoff, "rebase-merge/signoff") static GIT_PATH_FUNC(rebase_path_head_name, "rebase-merge/head-name") static GIT_PATH_FUNC(rebase_path_onto, "rebase-merge/onto") static GIT_PATH_FUNC(rebase_path_autostash, "rebase-merge/autostash") @@ -1605,7 +1606,7 @@ static int do_pick_commit(enum todo_command command, struct commit *commit, } } - if (opts->signoff) + if (opts->signoff && !is_fixup(command)) append_signoff(&msgbuf, 0, 0); if (is_rebase_i(opts) && write_author_script(msg.message) < 0) @@ -2035,6 +2036,11 @@ static int read_populate_opts(struct replay_opts *opts) if (file_exists(rebase_path_verbose())) opts->verbose = 1; + if (file_exists(rebase_path_signoff())) { + opts->allow_ff = 0; + opts->signoff = 1; + } + read_strategy_opts(opts, &buf); strbuf_release(&buf); |