Skip to content

Commit

Permalink
log: introduce init_log_defaults()
Browse files Browse the repository at this point in the history
This is currently a wrapper around init_grep_defaults(), but will allow
adding more initialization in further patches.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Matthieu Moy authored and Junio C Hamano committed Feb 25, 2016
1 parent a9276a6 commit 9501d19
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions builtin/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ static int log_line_range_callback(const struct option *option, const char *arg,
return 0;
}

static void init_log_defaults(void)
{
init_grep_defaults();
}

static void cmd_log_init_defaults(struct rev_info *rev)
{
if (fmt_pretty)
Expand Down Expand Up @@ -416,7 +421,7 @@ int cmd_whatchanged(int argc, const char **argv, const char *prefix)
struct rev_info rev;
struct setup_revision_opt opt;

init_grep_defaults();
init_log_defaults();
git_config(git_log_config, NULL);

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

init_grep_defaults();
init_log_defaults();
git_config(git_log_config, NULL);

memset(&match_all, 0, sizeof(match_all));
Expand Down Expand Up @@ -608,7 +613,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();
init_log_defaults();
git_config(git_log_config, NULL);

init_revisions(&rev, prefix);
Expand Down Expand Up @@ -647,7 +652,7 @@ int cmd_log(int argc, const char **argv, const char *prefix)
struct rev_info rev;
struct setup_revision_opt opt;

init_grep_defaults();
init_log_defaults();
git_config(git_log_config, NULL);

init_revisions(&rev, prefix);
Expand Down Expand Up @@ -1280,7 +1285,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();
init_log_defaults();
git_config(git_format_config, NULL);
init_revisions(&rev, prefix);
rev.commit_format = CMIT_FMT_EMAIL;
Expand Down

0 comments on commit 9501d19

Please sign in to comment.