diff: load funcname patterns in "basic" config

The funcname patterns influence the "comment" on @@ lines of
the diff. They are safe to use with plumbing since they
don't fundamentally change the meaning of the diff in any
way.

Since all diff users call either diff_ui_config or
diff_basic_config, we can get rid of the lazy reading of the
config.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jeff King 2008-01-04 04:16:14 -05:00 коммит произвёл Junio C Hamano
Родитель 9a1805a872
Коммит e467193ff3
1 изменённых файлов: 8 добавлений и 3 удалений

11
diff.c
Просмотреть файл

@ -174,8 +174,6 @@ int git_diff_ui_config(const char *var, const char *value)
if (ep != var + 4) {
if (!strcmp(ep, ".command"))
return parse_lldiff_command(var, ep, value);
if (!strcmp(ep, ".funcname"))
return parse_funcname_pattern(var, ep, value);
}
}
@ -190,6 +188,14 @@ int git_diff_basic_config(const char *var, const char *value)
return 0;
}
if (!prefixcmp(var, "diff.")) {
const char *ep = strrchr(var, '.');
if (ep != var + 4) {
if (!strcmp(ep, ".funcname"))
return parse_funcname_pattern(var, ep, value);
}
}
return git_default_config(var, value);
}
@ -1160,7 +1166,6 @@ static const char *funcname_pattern(const char *ident)
{
struct funcname_pattern *pp;
read_config_if_needed();
for (pp = funcname_pattern_list; pp; pp = pp->next)
if (!strcmp(ident, pp->name))
return pp->pattern;