Code

Merge branch 'bc/maint-fetch-url-only'
[git.git] / builtin / log.c
index f068583618d4120756ea394f9d64a4461f1c0c4b..eaa1ee0fa71a344af747dec038c6a5907c8273a5 100644 (file)
@@ -125,6 +125,7 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,
                rev->show_decorations = 1;
                load_ref_decorations(decoration_style);
        }
+       setup_pager();
 }
 
 /*
@@ -296,6 +297,9 @@ static int git_log_config(const char *var, const char *value, void *cb)
                default_show_root = git_config_bool(var, value);
                return 0;
        }
+       if (!prefixcmp(var, "color.decorate."))
+               return parse_decorate_color_config(var, 15, value);
+
        return git_diff_ui_config(var, value, cb);
 }
 
@@ -488,12 +492,6 @@ int cmd_log_reflog(int argc, const char **argv, const char *prefix)
        rev.use_terminator = 1;
        rev.always_show_header = 1;
 
-       /*
-        * We get called through "git reflog", so unlike the other log
-        * routines, we need to set up our pager manually..
-        */
-       setup_pager();
-
        return cmd_log_walk(&rev);
 }
 
@@ -535,13 +533,13 @@ static void add_header(const char *value)
                len--;
 
        if (!strncasecmp(value, "to: ", 4)) {
-               item = string_list_append(value + 4, &extra_to);
+               item = string_list_append(&extra_to, value + 4);
                len -= 4;
        } else if (!strncasecmp(value, "cc: ", 4)) {
-               item = string_list_append(value + 4, &extra_cc);
+               item = string_list_append(&extra_cc, value + 4);
                len -= 4;
        } else {
-               item = string_list_append(value, &extra_hdr);
+               item = string_list_append(&extra_hdr, value);
        }
 
        item->string[len] = '\0';
@@ -566,13 +564,13 @@ static int git_format_config(const char *var, const char *value, void *cb)
        if (!strcmp(var, "format.to")) {
                if (!value)
                        return config_error_nonbool(var);
-               string_list_append(value, &extra_to);
+               string_list_append(&extra_to, value);
                return 0;
        }
        if (!strcmp(var, "format.cc")) {
                if (!value)
                        return config_error_nonbool(var);
-               string_list_append(value, &extra_cc);
+               string_list_append(&extra_cc, value);
                return 0;
        }
        if (!strcmp(var, "diff.color") || !strcmp(var, "color.diff")) {
@@ -959,7 +957,7 @@ static int to_callback(const struct option *opt, const char *arg, int unset)
        if (unset)
                string_list_clear(&extra_to, 0);
        else
-               string_list_append(arg, &extra_to);
+               string_list_append(&extra_to, arg);
        return 0;
 }
 
@@ -968,7 +966,7 @@ static int cc_callback(const struct option *opt, const char *arg, int unset)
        if (unset)
                string_list_clear(&extra_cc, 0);
        else
-               string_list_append(arg, &extra_cc);
+               string_list_append(&extra_cc, arg);
        return 0;
 }
 
@@ -1251,7 +1249,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
                rev.ref_message_ids = xcalloc(1, sizeof(struct string_list));
        if (in_reply_to) {
                const char *msgid = clean_message_id(in_reply_to);
-               string_list_append(msgid, rev.ref_message_ids);
+               string_list_append(rev.ref_message_ids, msgid);
        }
        rev.numbered_files = numbered_files;
        rev.patch_suffix = fmt_patch_suffix;
@@ -1298,8 +1296,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
                                    && (!cover_letter || rev.nr > 1))
                                        free(rev.message_id);
                                else
-                                       string_list_append(rev.message_id,
-                                                          rev.ref_message_ids);
+                                       string_list_append(rev.ref_message_ids,
+                                                          rev.message_id);
                        }
                        gen_message_id(&rev, sha1_to_hex(commit->object.sha1));
                }