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

[PATCH] gitweb: Use $hash_base as $search_hash if possible

From
THTimo Hirvonen <tihirvon@gmail.com>
Date
Jun 20, 2006, 13:41 UTC
Message-ID
<20060620164105.7276a45f.tihirvon@gmail.com>
In-Reply-To
<7v64iw80uo.fsf@assigned-by-dhcp.cox.net>

$hash (h parameter) does not always point to a commit. Use $hash_base as $search_hash when it is defined.

Signed-off-by: Timo Hirvonen <tihirvon@gmail.com>
---
  Junio C Hamano <junkio@cox.net> wrote:
  
  > Timo Hirvonen <tihirvon@gmail.com> writes:
  > 
  > > 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.
  > 
  > If h is not a commit, perhaps, but wouldn't you expect it to
  > find things from "next" branch if "h" points at it?
  I did not change it to start search from tip of the branch. The
  current behavior is somewhat confusing but at least it is consistent
  with rest of gitweb.  For example clicking shortlog link from commit
  view shows the current commit at top of the list, not tip of the
  current branch.
 gitweb/gitweb.cgi |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index 78e6dd0..7318512 100755
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
@@ -293,7 +293,9 @@ EOF
 			$searchtext = "";
 		}
 		my $search_hash;
-		if (defined $hash) {
+		if (defined $hash_base) {
+			$search_hash = $hash_base;
+		} elsif (defined $hash) {
 			$search_hash = $hash;
 		} else {
 			$search_hash  = "HEAD";
-- 
1.4.0.gd281
Previous: Junio C Hamano
Message 3 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.