Re: [PATCH v2 18/25] sequencer: support cleaning up commit messages
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 12, 2016, 21:33 UTC
- Message-ID
- <xmqqd1k8ztv7.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <773ba280e64c2dfabff0d6e6a0a0808482461677.1473590966.git.johannes.schindelin@gmx.de>
Johannes Schindelin <johannes.schindelin@gmx.de> writes:
Show 9 quoted lines
> @@ -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
Show 20 quoted lines
> 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.