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

[PATCH 3/4] gitweb.cgi: Show "raw" head of project link even when $hash is not defined

From
LTLuben Tuikov <ltuikov@yahoo.com>
Date
Jul 23, 2006, 20:30 UTC
Message-ID
<20060723203008.94485.qmail@web31805.mail.mud.yahoo.com>

Some callers of git_history() do not set $hash of $file_name. Add code to find it, if it is not defined.

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
---
 gitweb/gitweb.cgi |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index 7a61de4..c04283b 100755
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
@@ -2326,7 +2326,9 @@ sub git_history {
 	print "<div>\n" .
 	      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$hash_base"), -class => "title"}, esc_html($co{'title'})) . "\n" .
 	      "</div>\n";
+	if (!defined $hash && defined $file_name) {
+		$hash = git_get_hash_by_path($hash_base, $file_name);
+	}
 	if (defined $hash) {
 		my $ftype = git_get_type($hash);
 
-- 
1.4.2.rc1.g9b54
Message 1 of 1 in “gitweb.cgi: Show "raw" head of project link even when $hash is not defined”
  1. 3/4 gitweb.cgi: Show "raw" head of project link even when $hash is not definedLuben Tuikov, Jul 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.