All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Subject: [PATCH 6/6] log --grep: honor grep.patterntype etc. configuration variables
Date: Wed,  3 Oct 2012 18:33:39 -0700	[thread overview]
Message-ID: <1349314419-8397-7-git-send-email-gitster@pobox.com> (raw)
In-Reply-To: <1349314419-8397-1-git-send-email-gitster@pobox.com>

Read grep.extendedregexp, grep.patterntype, etc. from the
configuration so that "log --grep='<pcre>'" honors the user
preference without an explicit -P from the command line.

Now that the callback parameter, which was so far unused, to
git_log_config() has to be of type "struct rev_info *", stop passing
it down to git_diff_ui_config().  The latter does not currently take
any callback parameter, and when it does, we would need to make a
structure that has rev info and that parameter and pass it to
git_log_config() anyway, and until that happens, passing NULL will
be less error prone.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 builtin/log.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/builtin/log.c b/builtin/log.c
index 07a0078..a38a6dd 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -329,6 +329,8 @@ static int cmd_log_walk(struct rev_info *rev)
 
 static int git_log_config(const char *var, const char *value, void *cb)
 {
+	struct rev_info *revs = cb;
+
 	if (!strcmp(var, "format.pretty"))
 		return git_config_string(&fmt_pretty, var, value);
 	if (!strcmp(var, "format.subjectprefix"))
@@ -352,7 +354,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);
 
-	return git_diff_ui_config(var, value, cb);
+	grep_config(var, value, &revs->grep_filter);
+	return git_diff_ui_config(var, value, NULL);
 }
 
 int cmd_whatchanged(int argc, const char **argv, const char *prefix)
-- 
1.8.0.rc0.57.g712528f

  parent reply	other threads:[~2012-10-04 21:54 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-01 22:44 [ANNOUNCE] Git v1.8.0-rc0 Junio C Hamano
2012-10-03 20:18 ` grep.patternType (was: Re: [ANNOUNCE] Git v1.8.0-rc0) Junio C Hamano
2012-10-03 22:14   ` grep.patternType Junio C Hamano
2012-10-04  6:05     ` grep.patternType Michal Kiedrowicz
2012-10-05  5:38     ` grep.patternType J Smith
2012-10-04  1:33   ` [PATCH 0/6] Tying loose ends of extended "grep" Junio C Hamano
2012-10-04  1:33     ` [PATCH 1/6] grep: move configuration support to top-level grep.[ch] Junio C Hamano
2012-10-04  1:33     ` [PATCH 2/6] grep: move pattern-type bits " Junio C Hamano
2012-10-04  1:33     ` [PATCH 3/6] log --grep: use the same helper to set -E/-F options as "git grep" Junio C Hamano
2012-10-04  8:09       ` Jeff King
2012-10-04  1:33     ` [PATCH 4/6] log --grep: accept --basic-regexp and --perl-regexp Junio C Hamano
2012-10-04  8:12       ` Jeff King
2012-10-04 16:44         ` Junio C Hamano
2012-10-04  1:33     ` [PATCH 5/6] log: pass rev_info to git_log_config() Junio C Hamano
2012-10-04  7:05       ` Junio C Hamano
2012-10-05  4:16         ` Junio C Hamano
2012-10-05 15:33           ` Jeff King
2012-10-05 19:07             ` Junio C Hamano
2012-10-04  1:33     ` Junio C Hamano [this message]
2012-10-04  8:17       ` [PATCH 6/6] log --grep: honor grep.patterntype etc. configuration variables Jeff King
2012-10-04 16:46         ` Junio C Hamano
2012-10-04 18:01           ` Jeff King
2012-10-04 19:09             ` Junio C Hamano

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=1349314419-8397-7-git-send-email-gitster@pobox.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.