Re: [PATCH v2 18/25] sequencer: support cleaning up commit messages
From: Junio C Hamano <hidden>
Date: 2016-09-12 21:33:08
Johannes Schindelin [off-list ref] writes:
quoted hunk
@@ -788,7 +792,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, 0); + opts, allow, opts->edit, 0, 0); leave: free_message(commit, &msg);
So the existing caller did not ask to cleanup
quoted hunk
int sequencer_commit(const char *defmsg, struct replay_opts *opts, - int allow_empty, int edit, int amend) + int allow_empty, int edit, int amend, + int cleanup_commit_message) { char **env = NULL; struct argv_array array;@@ -522,9 +523,12 @@ 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 (cleanup_commit_message) + argv_array_push(&array, "--cleanup=strip"); if (edit) argv_array_push(&array, "-e"); - else if (!opts->signoff && !opts->record_origin && + else if (!cleanup_commit_message && + !opts->signoff && !opts->record_origin && git_config_get_value("commit.cleanup", &value)) argv_array_push(&array, "--cleanup=verbatim");
Which is consistent with this change. This is a no-op enhancement for existing callers and makes new callers to ask for cleaning up. We will see if a hardcoded "--cleanup=strip" is sufficient when we see new callers (we _know_ it would be sufficient for the first new caller by definition ;-). Makes sense. Thanks.