summaryrefslogtreecommitdiff
path: root/gitweb
diff options
context:
space:
mode:
authorRobert Fitzsimons <robfitz@273k.net>2006-12-23 03:35:14 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-12-23 07:18:40 (GMT)
commit8e574fb542eaf7f41d5416b2cf65b5c2e93829d6 (patch)
tree5924ce8f52e5d16d66deffcfa06bc3b580c65e02 /gitweb
parent0a5761746ca046d546da6afc2b0079706a6629e0 (diff)
downloadgit-8e574fb542eaf7f41d5416b2cf65b5c2e93829d6.zip
git-8e574fb542eaf7f41d5416b2cf65b5c2e93829d6.tar.gz
git-8e574fb542eaf7f41d5416b2cf65b5c2e93829d6.tar.bz2
gitweb: Use rev-list pattern search options.
Use rev-list pattern search options instead of hand coded perl. Signed-off-by: Robert Fitzsimons <robfitz@273k.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'gitweb')
-rwxr-xr-xgitweb/gitweb.perl20
1 files changed, 10 insertions, 10 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index b0e6fdf..c1e8bbc 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -4176,20 +4176,20 @@ sub git_search {
print "<table cellspacing=\"0\">\n";
my $alternate = 1;
if ($searchtype eq 'commit' or $searchtype eq 'author' or $searchtype eq 'committer') {
+ my $greptype;
+ if ($searchtype eq 'commit') {
+ $greptype = "--grep=";
+ } elsif ($searchtype eq 'author') {
+ $greptype = "--author=";
+ } elsif ($searchtype eq 'committer') {
+ $greptype = "--committer=";
+ }
$/ = "\0";
open my $fd, "-|", git_cmd(), "rev-list",
- "--header", "--parents", $hash, "--"
+ "--header", "--parents", ($greptype . $searchtext),
+ $hash, "--"
or next;
while (my $commit_text = <$fd>) {
- if (!grep m/$searchtext/i, $commit_text) {
- next;
- }
- if ($searchtype eq 'author' && !grep m/\nauthor .*$searchtext/i, $commit_text) {
- next;
- }
- if ($searchtype eq 'committer' && !grep m/\ncommitter .*$searchtext/i, $commit_text) {
- next;
- }
my @commit_lines = split "\n", $commit_text;
my %co = parse_commit(undef, \@commit_lines);
if (!%co) {