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

[PATCH] gitweb: Start search from HEAD

From
THTimo Hirvonen <tihirvon@gmail.com>
Date
Jun 20, 2006, 12:25 UTC
Message-ID
<20060620152515.23e59396.tihirvon@gmail.com>

Starting search from whatever the current "h" parameter points to is wrong. Sometimes it doesn't give all the expected results or may even fail if h points to an object which is not a commit.

Signed-off-by: Timo Hirvonen <tihirvon@gmail.com>
---
 This patch is against the "next" branch.
 gitweb/gitweb.cgi |   11 +----------
 1 files changed, 1 insertions(+), 10 deletions(-)
diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index 78e6dd0..3ad23a3 100755
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
@@ -292,14 +292,7 @@ EOF
 		if (!defined $searchtext) {
 			$searchtext = "";
 		}
-		my $search_hash;
-		if (defined $hash) {
-			$search_hash = $hash;
-		} else {
-			$search_hash  = "HEAD";
-		}
 		$cgi->param("a", "search");
-		$cgi->param("h", $search_hash);
 		print $cgi->startform(-method => "get", -action => $my_uri) .
 		      "<div class=\"search\">\n" .
 		      $cgi->hidden(-name => "p") . "\n" .
@@ -2328,9 +2321,7 @@ sub git_search {
 	if (!defined $searchtext) {
 		die_error("", "Text field empty.");
 	}
-	if (!defined $hash) {
-		$hash = git_read_head($project);
-	}
+	$hash = "HEAD";
 	my %co = git_read_commit($hash);
 	if (!%co) {
 		die_error(undef, "Unknown commit object.");
-- 
1.4.0.gd281
Next: Junio C Hamano
Message 1 of 3 in “gitweb: Start search from HEAD”
  1. gitweb: Start search from HEADTimo Hirvonen, Jun 20, 2006
  2. Junio C HamanoJun 20, 2006
  3. gitweb: Use $hash_base as $search_hash if possibleTimo Hirvonen, Jun 20, 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.