aboutsummaryrefslogtreecommitdiff
path: root/revision.c
diff options
context:
space:
mode:
authorJakub Narebski <jnareb@gmail.com>2008-02-26 13:22:05 +0100
committerJunio C Hamano <gitster@pobox.com>2008-02-26 23:59:49 -0800
commitdc1c0fffd3723ceebff51053938db5baf26a47f5 (patch)
tree067c6b83d4c24ae9ff32e029150b16505fe00485 /revision.c
parentc6fabfafbcebca13cee0047b337b7c7a87e3515e (diff)
downloadgit-dc1c0fffd3723ceebff51053938db5baf26a47f5.tar.gz
git-dc1c0fffd3723ceebff51053938db5baf26a47f5.tar.xz
Add '--fixed-strings' option to "git log --grep" and friends
Add support for -F | --fixed-strings option to "git log --grep" and friends: "git log --author", "git log --committer=<pattern>". Code is based on implementation of this option in "git grep". Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'revision.c')
-rw-r--r--revision.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/revision.c b/revision.c
index d3e865810..5df7961c5 100644
--- a/revision.c
+++ b/revision.c
@@ -942,6 +942,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
int left = 1;
int all_match = 0;
int regflags = 0;
+ int fixed = 0;
/* First, search for "--" */
seen_dashdash = 0;
@@ -1238,6 +1239,11 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
regflags |= REG_ICASE;
continue;
}
+ if (!strcmp(arg, "--fixed-strings") ||
+ !strcmp(arg, "-F")) {
+ fixed = 1;
+ continue;
+ }
if (!strcmp(arg, "--all-match")) {
all_match = 1;
continue;
@@ -1293,8 +1299,10 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
}
}
- if (revs->grep_filter)
+ if (revs->grep_filter) {
revs->grep_filter->regflags |= regflags;
+ revs->grep_filter->fixed = fixed;
+ }
if (show_merge)
prepare_show_merge(revs);