aboutsummaryrefslogtreecommitdiff
path: root/builtin/merge.c
diff options
context:
space:
mode:
authorRamkumar Ramachandra <artagnon@gmail.com>2010-09-08 23:29:55 +0530
committerJunio C Hamano <gitster@pobox.com>2010-09-09 11:39:23 -0700
commitbda3b8ff1735aecfb5265ed781548eab238d7a14 (patch)
tree726a983b0f5862a9a4974271cae1e609bb1048f9 /builtin/merge.c
parent96e9420cd357728949571b42eb0249881ae3a78e (diff)
downloadgit-bda3b8ff1735aecfb5265ed781548eab238d7a14.tar.gz
git-bda3b8ff1735aecfb5265ed781548eab238d7a14.tar.xz
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>
Diffstat (limited to 'builtin/merge.c')
-rw-r--r--builtin/merge.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/builtin/merge.c b/builtin/merge.c
index 9e4733d25..1e9c898ae 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -503,7 +503,12 @@ static int git_merge_config(const char *k, const char *v, void *cb)
else if (!strcmp(k, "pull.octopus"))
return git_config_string(&pull_octopus, k, v);
else if (!strcmp(k, "merge.log") || !strcmp(k, "merge.summary")) {
- shortlog_len = git_config_bool(k, v) ? DEFAULT_MERGE_LOG_LEN : 0;
+ int is_bool;
+ shortlog_len = git_config_bool_or_int(k, v, &is_bool);
+ if (!is_bool && shortlog_len < 0)
+ return error("%s: negative length %s", k, v);
+ if (is_bool && shortlog_len)
+ shortlog_len = DEFAULT_MERGE_LOG_LEN;
return 0;
}
return git_diff_ui_config(k, v, cb);