git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 3/3] gitweb: Allow search to be disabled from the config file.

From
RFRobert Fitzsimons <robfitz@273k.net>
Date
Dec 23, 2006, 03:35 UTC
Message-ID
<11668449274162-git-send-email-robfitz@273k.net>
In-Reply-To
<11668449271631-git-send-email-robfitz@273k.net>
Signed-off-by: Robert Fitzsimons <robfitz@273k.net>
---
 gitweb/gitweb.perl |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 6778b24..e8f63aa 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -128,6 +128,12 @@ our %feature = (
 		#         => [content-encoding, suffix, program]
 		'default' => ['x-gzip', 'gz', 'gzip']},
 
+	# Enable text search, which will list the commits which match author, 
+	# committer or commit text to a given string.  Enabled by default.
+	'search' => {
+		'override' => 0,
+		'default' => [1]},
+
 	# Enable the pickaxe search, which will list the commits that modified
 	# a given string in a file. This can be practical and quite faster
 	# alternative to 'blame', but still potentially CPU-intensive.
@@ -1729,6 +1735,9 @@ EOF
 			print " / $action";
 		}
 		print "\n";
+	}
+	my ($have_search) = gitweb_check_feature('search');
+	if ((defined $project) && ($have_search)) {
 		if (!defined $searchtext) {
 			$searchtext = "";
 		}
@@ -4147,6 +4156,10 @@ sub git_history {
 }
 
 sub git_search {
+	my ($have_search) = gitweb_check_feature('search');
+	if (!$have_search) {
+		die_error('403 Permission denied', "Permission denied");
+	}
 	if (!defined $searchtext) {
 		die_error(undef, "Text field empty");
 	}
-- 
1.4.4.3.gae7ae3
Previous: Robert FitzsimonsNext: Jakub Narebski
Message 3 of 10 in “gitweb: Use rev-list pattern search options.”
  1. 1/3 gitweb: Use rev-list pattern search options.Robert Fitzsimons, Dec 23, 2006
  2. 2/3 gitweb: Require a minimum of two character for the search text.Robert Fitzsimons, Dec 23, 2006
  3. 3/3 gitweb: Allow search to be disabled from the config file.Robert Fitzsimons, Dec 23, 2006
  4. Jakub NarebskiDec 23, 2006
  5. Robert FitzsimonsDec 23, 2006
  6. Jakub NarebskiDec 23, 2006
  7. gitweb: Paginate commit/author/committer search outputRobert Fitzsimons, Dec 23, 2006
  8. Jakub NarebskiDec 23, 2006
  9. Robert FitzsimonsDec 23, 2006
  10. Jakub NarebskiDec 23, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.