Skip to content

Commit 0657bcb

Browse files
committed
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 <[email protected]>
1 parent 727b6fc commit 0657bcb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

builtin/log.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,8 @@ static int git_log_config(const char *var, const char *value, void *cb)
351351
}
352352
if (!prefixcmp(var, "color.decorate."))
353353
return parse_decorate_color_config(var, 15, value);
354-
354+
if (grep_config(var, value, cb) < 0)
355+
return -1;
355356
return git_diff_ui_config(var, value, cb);
356357
}
357358

@@ -360,6 +361,7 @@ int cmd_whatchanged(int argc, const char **argv, const char *prefix)
360361
struct rev_info rev;
361362
struct setup_revision_opt opt;
362363

364+
init_grep_defaults();
363365
git_config(git_log_config, NULL);
364366

365367
init_revisions(&rev, prefix);
@@ -450,6 +452,7 @@ int cmd_show(int argc, const char **argv, const char *prefix)
450452
struct pathspec match_all;
451453
int i, count, ret = 0;
452454

455+
init_grep_defaults();
453456
git_config(git_log_config, NULL);
454457

455458
init_pathspec(&match_all, NULL);
@@ -530,6 +533,7 @@ int cmd_log_reflog(int argc, const char **argv, const char *prefix)
530533
struct rev_info rev;
531534
struct setup_revision_opt opt;
532535

536+
init_grep_defaults();
533537
git_config(git_log_config, NULL);
534538

535539
init_revisions(&rev, prefix);
@@ -552,6 +556,7 @@ int cmd_log(int argc, const char **argv, const char *prefix)
552556
struct rev_info rev;
553557
struct setup_revision_opt opt;
554558

559+
init_grep_defaults();
555560
git_config(git_log_config, NULL);
556561

557562
init_revisions(&rev, prefix);
@@ -1121,6 +1126,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
11211126
extra_hdr.strdup_strings = 1;
11221127
extra_to.strdup_strings = 1;
11231128
extra_cc.strdup_strings = 1;
1129+
init_grep_defaults();
11241130
git_config(git_format_config, NULL);
11251131
init_revisions(&rev, prefix);
11261132
rev.commit_format = CMIT_FMT_EMAIL;

0 commit comments

Comments
 (0)