Skip to content

Commit

Permalink
log: honor grep.* configuration
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Oct 10, 2012
1 parent 727b6fc commit 0657bcb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion builtin/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,8 @@ static int git_log_config(const char *var, const char *value, void *cb)
}
if (!prefixcmp(var, "color.decorate."))
return parse_decorate_color_config(var, 15, value);

if (grep_config(var, value, cb) < 0)
return -1;
return git_diff_ui_config(var, value, cb);
}

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

init_grep_defaults();
git_config(git_log_config, NULL);

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

init_grep_defaults();
git_config(git_log_config, NULL);

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

init_grep_defaults();
git_config(git_log_config, NULL);

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

init_grep_defaults();
git_config(git_log_config, NULL);

init_revisions(&rev, prefix);
Expand Down Expand Up @@ -1121,6 +1126,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
extra_hdr.strdup_strings = 1;
extra_to.strdup_strings = 1;
extra_cc.strdup_strings = 1;
init_grep_defaults();
git_config(git_format_config, NULL);
init_revisions(&rev, prefix);
rev.commit_format = CMIT_FMT_EMAIL;
Expand Down

0 comments on commit 0657bcb

Please sign in to comment.