From: Junio C Hamano Date: Wed, 29 Sep 2010 20:48:20 +0000 (-0700) Subject: Merge branch 'rr/fmt-merge-msg' X-Git-Tag: v1.7.4-rc0~207 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=02ef0ed7102a197e2b746f3e694c09915fa98060;p=git.git Merge branch 'rr/fmt-merge-msg' * rr/fmt-merge-msg: t6200-fmt-merge-msg: Exercise '--log' to configure shortlog length t6200-fmt-merge-msg: Exercise 'merge.log' to configure shortlog length merge: Make 'merge.log' an integer or boolean option merge: Make '--log' an integer option for number of shortlog entries fmt_merge_msg: Change fmt_merge_msg API to accept shortlog_len Conflicts: builtin/merge.c --- 02ef0ed7102a197e2b746f3e694c09915fa98060 diff --cc builtin.h index 0398d2474,09b94ea44..f2a25a084 --- a/builtin.h +++ b/builtin.h @@@ -11,10 -13,11 +13,9 @@@ extern const char git_version_string[] extern const char git_usage_string[]; extern const char git_more_info_string[]; -extern void list_common_cmds_help(void); -extern const char *help_unknown_cmd(const char *cmd); extern void prune_packed_objects(int); - extern int fmt_merge_msg(int merge_summary, struct strbuf *in, - struct strbuf *out); - extern int fmt_merge_msg_shortlog(struct strbuf *in, struct strbuf *out); + extern int fmt_merge_msg(struct strbuf *in, struct strbuf *out, + int merge_title, int shortlog_len); extern int commit_notes(struct notes_tree *t, const char *msg); struct notes_rewrite_cfg { diff --cc builtin/merge.c index 5f65c0c8a,1e9c898ae..2dba3b990 --- a/builtin/merge.c +++ b/builtin/merge.c @@@ -504,10 -502,15 +505,17 @@@ static int git_merge_config(const char return git_config_string(&pull_twohead, k, v); else if (!strcmp(k, "pull.octopus")) return git_config_string(&pull_octopus, k, v); - else if (!strcmp(k, "merge.log") || !strcmp(k, "merge.summary")) - option_log = git_config_bool(k, v); + else if (!strcmp(k, "merge.renormalize")) + option_renormalize = git_config_bool(k, v); + else if (!strcmp(k, "merge.log") || !strcmp(k, "merge.summary")) { + 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); }