sequencer: allow editing the commit message on a case-by-case basis

In the upcoming commits, we will implement more and more of rebase
-i's functionality. One particular feature of the commands to come is
that some of them allow editing the commit message while others don't,
i.e. we cannot define in the replay_opts whether the commit message
should be edited or not.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin
2016-03-04 16:13:26 +01:00
parent 80d91ee1f0
commit cd659a0be5
2 changed files with 4 additions and 4 deletions

View File

@@ -485,7 +485,7 @@ static char **read_author_script(void)
* author metadata.
*/
int sequencer_commit(const char *defmsg, struct replay_opts *opts,
int allow_empty)
int allow_empty, int edit)
{
char **env = NULL;
struct argv_array array;
@@ -520,7 +520,7 @@ int sequencer_commit(const char *defmsg, struct replay_opts *opts,
argv_array_push(&array, "-s");
if (defmsg)
argv_array_pushl(&array, "-F", defmsg, NULL);
if (opts->edit)
if (edit)
argv_array_push(&array, "-e");
else if (!opts->signoff && !opts->record_origin &&
git_config_get_value("commit.cleanup", &value))
@@ -786,7 +786,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, allow, opts->edit);
leave:
free_message(commit, &msg);

View File

@@ -54,7 +54,7 @@ int sequencer_rollback(struct replay_opts *opts);
int sequencer_remove_state(struct replay_opts *opts);
int sequencer_commit(const char *defmsg, struct replay_opts *opts,
int allow_empty);
int allow_empty, int edit);
extern const char sign_off_header[];