diff options
author | Ramkumar Ramachandra <artagnon@gmail.com> | 2010-09-08 23:29:53 +0530 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-09-09 11:39:20 -0700 |
commit | 1876166aaab56056083e6a61de4423d130d4dcc6 (patch) | |
tree | 36aa247bd4c5ab3009ce3d8ee5837ad36ae34145 /builtin/merge.c | |
parent | fdc4408a8980392f2cc30dc125906a61edf170ec (diff) | |
download | git-1876166aaab56056083e6a61de4423d130d4dcc6.tar.gz |
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>
Diffstat (limited to 'builtin/merge.c')
-rw-r--r-- | builtin/merge.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/builtin/merge.c b/builtin/merge.c index 2207f79969..b2c09848fd 100644 --- a/builtin/merge.c +++ b/builtin/merge.c @@ -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) |