merge: Make 'merge.log' an integer or boolean option
Make 'merge.log' an integer or boolean option to set the number of shortlog entries to display in the merge commit. Note that it defaults to false, and that true means a default value of 20. Also update corresponding documentation. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Thanks-to: Jonathan Nieder <jrnieder@gmail.com> Thanks-to: Johannes Sixt <j.sixt@viscovery.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
96e9420cd3
commit
bda3b8ff17
@ -15,15 +15,13 @@ static int shortlog_len;
|
||||
|
||||
static int fmt_merge_msg_config(const char *key, const char *value, void *cb)
|
||||
{
|
||||
static int found_merge_log = 0;
|
||||
if (!strcmp("merge.log", key)) {
|
||||
found_merge_log = 1;
|
||||
shortlog_len = git_config_bool(key, value) ? DEFAULT_MERGE_LOG_LEN : 0;
|
||||
return 0;
|
||||
}
|
||||
if (!found_merge_log && !strcmp("merge.summary", key)) {
|
||||
shortlog_len = git_config_bool(key, value) ? DEFAULT_MERGE_LOG_LEN : 0;
|
||||
return 0;
|
||||
if (!strcmp(key, "merge.log") || !strcmp(key, "merge.summary")) {
|
||||
int is_bool;
|
||||
shortlog_len = git_config_bool_or_int(key, value, &is_bool);
|
||||
if (!is_bool && shortlog_len < 0)
|
||||
return error("%s: negative length %s", key, value);
|
||||
if (is_bool && shortlog_len)
|
||||
shortlog_len = DEFAULT_MERGE_LOG_LEN;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user