Code

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
index 0398d247400e55f2a2ededc054902374c7516d5b,09b94ea4409ed497aff68012baad897de961e80d..f2a25a084736e573f560672fabc9c6214997f437
+++ 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
index 5f65c0c8a6eacd4c6d05602ad9de2821ec62a034,1e9c898aec2834577689b430739607a50508498a..2dba3b9901cbdca9aee279339ecd3537e15e39da
@@@ -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);
  }