Re: [PATCH 18/22] sequencer: support amending commits
From: Johannes Schindelin <hidden>
Date: 2016-09-01 13:42:47
Hi Kuba, On Wed, 31 Aug 2016, Jakub Narębski wrote:
W dniu 29.08.2016 o 10:06, Johannes Schindelin pisze:quoted
diff --git a/sequencer.c b/sequencer.c index 7e17d14..20f7590 100644 --- a/sequencer.c +++ b/sequencer.c@@ -478,7 +478,7 @@ static char **read_author_script(void) * (except, of course, while running an interactive rebase). */ int sequencer_commit(const char *defmsg, struct replay_opts *opts, - int allow_empty, int edit) + int allow_empty, int edit, int amend)I guess we won't get much more parameters; it would get unwieldy (and hard to remember). Five is all right.
It will eventually get a sixth, cleanup_commit_message.
quoted
{ char **env = NULL; struct argv_array array;@@ -507,6 +507,8 @@ int sequencer_commit(const char *defmsg, struct replay_opts *opts, argv_array_push(&array, "commit"); argv_array_push(&array, "-n"); + if (amend) + argv_array_push(&array, "--amend"); if (opts->gpg_sign) argv_array_pushf(&array, "-S%s", opts->gpg_sign); if (opts->signoff)@@ -779,7 +781,7 @@ static int do_pick_commit(enum todo_command command, struct commit *commit, } if (!opts->no_commit) res = sequencer_commit(opts->edit ? NULL : git_path_merge_msg(), - opts, allow, opts->edit); + opts, allow, opts->edit, 0);... even of this makes one need to check the calling convention, what does this 0 mean.
Yeah, but it will not remain "0", but be replaced by a variable named "amend"... Thanks for the review, Dscho