fmt_merge_msg: Change fmt_merge_msg API to accept shortlog_len

Give "shortlog_len" parameter to the fmt_merge_msg(), remove its
"merge_summary" parameter, and remove fmt_merge_msg_shortlog() function.
In the updated API, shortlog_len == 0 means no shortlog is given.

The parameter "merge_title" controls if the title of the merge commit is
autogenerated (it reads something like "Merge branch ..."), and typically
it is set to true when the caller does not give its own message.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Mentored-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Ramkumar Ramachandra
2010-09-08 23:29:53 +05:30
committed by Junio C Hamano
parent fdc4408a89
commit 1876166aaa
3 changed files with 24 additions and 27 deletions

View File

@ -998,14 +998,12 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
for (i = 0; i < argc; i++)
merge_name(argv[i], &merge_names);
if (have_message && option_log)
fmt_merge_msg_shortlog(&merge_names, &merge_msg);
else if (!have_message)
fmt_merge_msg(option_log, &merge_names, &merge_msg);
if (!(have_message && !option_log) && merge_msg.len)
strbuf_setlen(&merge_msg, merge_msg.len-1);
if (!have_message || option_log) {
fmt_merge_msg(&merge_names, &merge_msg, !have_message,
option_log ? DEFAULT_MERGE_LOG_LEN : 0);
if (merge_msg.len)
strbuf_setlen(&merge_msg, merge_msg.len - 1);
}
}
if (head_invalid || !argc)