From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: [PATCH] diff: load funcname patterns in "basic" config
Date: Fri, 4 Jan 2008 04:16:14 -0500 [thread overview]
Message-ID: <20080104091613.GA7535@coredump.intra.peff.net> (raw)
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>
---
I am slightly worried that I'm missing something fundamental here. Why
were these ever lazily loaded in the first place? Ditto for the user
diff drivers, which should just get loaded when the command parses the
config for the first time.
diff.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/diff.c b/diff.c
index 6bb0f62..1ea10c8 100644
--- a/diff.c
+++ b/diff.c
@@ -179,8 +179,6 @@ #include "run-command.h"
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);
}
}
@@ -195,6 +193,14 @@ #include "run-command.h"
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);
}
@@ -1165,7 +1171,6 @@ #include "run-command.h"
{
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;
--
1.5.4.rc2.1124.g7c85e-dirty
next reply other threads:[~2008-01-04 9:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-04 9:16 Jeff King [this message]
2008-01-04 9:19 ` [PATCH] diff: load funcname patterns in "basic" config Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080104091613.GA7535@coredump.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox