]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/log.c
config: pass kvi to die_bad_number()
[thirdparty/git.git] / builtin / log.c
index fee5834c0fc8cf4419c2b92a928ea790c552255b..c7337354aaf95d2e97e237104eca80549e0e9dd0 100644 (file)
 #include "gettext.h"
 #include "hex.h"
 #include "refs.h"
+#include "object-file.h"
+#include "object-name.h"
 #include "object-store.h"
+#include "pager.h"
 #include "color.h"
 #include "commit.h"
 #include "diff.h"
@@ -20,6 +23,7 @@
 #include "revision.h"
 #include "log-tree.h"
 #include "builtin.h"
+#include "oid-array.h"
 #include "tag.h"
 #include "reflog-walk.h"
 #include "patch-ids.h"
@@ -40,6 +44,7 @@
 #include "commit-reach.h"
 #include "range-diff.h"
 #include "tmp-objdir.h"
+#include "tree.h"
 #include "write-or-die.h"
 
 #define MAIL_DEFAULT_WRAP 72
@@ -559,7 +564,8 @@ static int cmd_log_walk(struct rev_info *rev)
        return retval;
 }
 
-static int git_log_config(const char *var, const char *value, void *cb)
+static int git_log_config(const char *var, const char *value,
+                         const struct config_context *ctx, void *cb)
 {
        const char *slot_name;
 
@@ -568,7 +574,7 @@ static int git_log_config(const char *var, const char *value, void *cb)
        if (!strcmp(var, "format.subjectprefix"))
                return git_config_string(&fmt_patch_subject_prefix, var, value);
        if (!strcmp(var, "format.filenamemaxlength")) {
-               fmt_patch_name_max = git_config_int(var, value);
+               fmt_patch_name_max = git_config_int(var, value, ctx->kvi);
                return 0;
        }
        if (!strcmp(var, "format.encodeemailheaders")) {
@@ -608,7 +614,7 @@ static int git_log_config(const char *var, const char *value, void *cb)
                return 0;
        }
 
-       return git_diff_ui_config(var, value, cb);
+       return git_diff_ui_config(var, value, ctx, cb);
 }
 
 int cmd_whatchanged(int argc, const char **argv, const char *prefix)
@@ -861,7 +867,7 @@ static void log_setup_revisions_tweak(struct rev_info *rev,
                                      struct setup_revision_opt *opt)
 {
        if (rev->diffopt.flags.default_follow_renames &&
-           rev->prune_data.nr == 1)
+           diff_check_follow_pathspec(&rev->prune_data, 0))
                rev->diffopt.flags.follow_renames = 1;
 
        if (rev->first_parent_only)
@@ -974,7 +980,8 @@ static enum cover_from_description parse_cover_from_description(const char *arg)
                die(_("%s: invalid cover from description mode"), arg);
 }
 
-static int git_format_config(const char *var, const char *value, void *cb)
+static int git_format_config(const char *var, const char *value,
+                            const struct config_context *ctx, void *cb)
 {
        if (!strcmp(var, "format.headers")) {
                if (!value)
@@ -1103,7 +1110,7 @@ static int git_format_config(const char *var, const char *value, void *cb)
        if (!strcmp(var, "diff.noprefix"))
                return 0;
 
-       return git_log_config(var, value, cb);
+       return git_log_config(var, value, ctx, cb);
 }
 
 static const char *output_directory = NULL;