Merge branch 'rr/fmt-merge-msg'
authorJunio C Hamano <gitster@pobox.com>
Wed, 29 Sep 2010 20:48:20 +0000 (13:48 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 29 Sep 2010 20:48:20 +0000 (13:48 -0700)
* 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

1  2 
Documentation/merge-config.txt
builtin.h
builtin/fmt-merge-msg.c
builtin/merge.c

Simple merge
diff --cc 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 {
Simple merge
diff --cc 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);
  }