log: honor grep.* configuration

Now the grep_config() callback is reusable from other configuration callbacks, call it from git_log_config() so that grep.patterntype and friends can be used with the commands in the "git log" family. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Oct 9, 2012 at 16:49 UTC 0657bcbf6f0830bc4ce25d05060706f35f1d4eb7
1 file changed +7 -1
builtin/log.c
+7 -1
@@ -351,7 +351,8 @@ static int git_log_config(const char *var, const char *value, void *cb)
351 }
352 if (!prefixcmp(var, "color.decorate."))
353 return parse_decorate_color_config(var, 15, value);
354 -
354 + if (grep_config(var, value, cb) < 0)
355 + return -1;
356 return git_diff_ui_config(var, value, cb);
357 }
358
@@ -360,6 +361,7 @@ int cmd_whatchanged(int argc, const char **argv, const char *prefix)
361 struct rev_info rev;
362 struct setup_revision_opt opt;
363
364 + init_grep_defaults();
365 git_config(git_log_config, NULL);
366
367 init_revisions(&rev, prefix);
@@ -450,6 +452,7 @@ int cmd_show(int argc, const char **argv, const char *prefix)
452 struct pathspec match_all;
453 int i, count, ret = 0;
454
455 + init_grep_defaults();
456 git_config(git_log_config, NULL);
457
458 init_pathspec(&match_all, NULL);
@@ -530,6 +533,7 @@ int cmd_log_reflog(int argc, const char **argv, const char *prefix)
533 struct rev_info rev;
534 struct setup_revision_opt opt;
535
536 + init_grep_defaults();
537 git_config(git_log_config, NULL);
538
539 init_revisions(&rev, prefix);
@@ -552,6 +556,7 @@ int cmd_log(int argc, const char **argv, const char *prefix)
556 struct rev_info rev;
557 struct setup_revision_opt opt;
558
559 + init_grep_defaults();
560 git_config(git_log_config, NULL);
561
562 init_revisions(&rev, prefix);
@@ -1121,6 +1126,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
1126 extra_hdr.strdup_strings = 1;
1127 extra_to.strdup_strings = 1;
1128 extra_cc.strdup_strings = 1;
1129 + init_grep_defaults();
1130 git_config(git_format_config, NULL);
1131 init_revisions(&rev, prefix);
1132 rev.commit_format = CMIT_FMT_EMAIL;