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

[PATCH 05/14] gitweb: allow refs passed to git_heads_body to use a name different from the hash name

From
Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Date
Aug 31, 2007, 10:59 UTC
Message-ID
<11885579922481-git-send-email-giuseppe.bilotta@gmail.com>
In-Reply-To
<cb7bb73a0708301915y47ca4a05nf511889b2bb2eaec@mail.gmail.com>
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
---
 gitweb/gitweb.perl |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 6aec28e..c46e982 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -3657,16 +3657,18 @@ sub git_heads_body {
 		} else {
 			print "<tr class=\"light\">\n";
 		}
+		my $hname = $ref{'hname'} || $ref{'name'};
+		my $name = $ref{'name'};
 		$alternate ^= 1;
 		print "<td><i>$ref{'age'}</i></td>\n" .
 		      ($curr ? "<td class=\"current_head\">" : "<td>") .
-		      $cgi->a({-href => href(action=>"shortlog", hash=>$ref{'name'}),
-		               -class => "list name"},esc_html($ref{'name'})) .
+		      $cgi->a({-href => href(action=>"shortlog", hash=>$hname),
+		               -class => "list name"},esc_html($name)) .
 		      "</td>\n" .
 		      "<td class=\"link\">" .
-		      $cgi->a({-href => href(action=>"shortlog", hash=>$ref{'name'})}, "shortlog") . " | " .
-		      $cgi->a({-href => href(action=>"log", hash=>$ref{'name'})}, "log") . " | " .
-		      $cgi->a({-href => href(action=>"tree", hash=>$ref{'name'}, hash_base=>$ref{'name'})}, "tree") .
+		      $cgi->a({-href => href(action=>"shortlog", hash=>$hname)}, "shortlog") . " | " .
+		      $cgi->a({-href => href(action=>"log", hash=>$hname)}, "log") . " | " .
+		      $cgi->a({-href => href(action=>"tree", hash=>$hname, hash_base=>$hname)}, "tree") .
 		      "</td>\n" .
 		      "</tr>";
 	}
-- 
1.5.2.5
Previous: Giuseppe BilottaNext: Giuseppe Bilotta
Message 16 of 25 in “gitweb and remote branches”
  1. Giuseppe BilottaAug 27, 2007
  2. Jakub NarebskiAug 27, 2007
  3. Jakub NarebskiAug 29, 2007
  4. Giuseppe BilottaAug 30, 2007
  5. Jakub NarebskiAug 30, 2007
  6. Giuseppe BilottaAug 30, 2007
  7. Junio C HamanoAug 30, 2007
  8. Giuseppe BilottaAug 30, 2007
  9. Jakub NarebskiAug 30, 2007
  10. Giuseppe BilottaAug 30, 2007
  11. Giuseppe BilottaAug 31, 2007
  12. 01/14 gitweb: get remotes too when getting heads listGiuseppe Bilotta, Aug 31, 2007
  13. 02/14 gitweb: make remote heads in heads list optionalGiuseppe Bilotta, Aug 31, 2007
  14. 03/14 gitweb: git_get_heads_list now accepts an optional list of refs.Giuseppe Bilotta, Aug 31, 2007
  15. 04/14 gitweb: separate heads and remotes list in summary viewGiuseppe Bilotta, Aug 31, 2007
  16. 05/14 gitweb: allow refs passed to git_heads_body to use a name different from the hash nameGiuseppe Bilotta, Aug 31, 2007
  17. 06/14 gitweb: git_split_heads_body function.Giuseppe Bilotta, Aug 31, 2007
  18. 07/14 gitweb: use CSS to style split head lists.Giuseppe Bilotta, Aug 31, 2007
  19. 08/14 gitweb: add 'remotes' action as a synonym for git_heads()Giuseppe Bilotta, Aug 31, 2007
  20. 09/14 gitweb: split heads list in head view if appropriateGiuseppe Bilotta, Aug 31, 2007
  21. 10/14 gitweb: display HEAD in heads list when detachedGiuseppe Bilotta, Aug 31, 2007
  22. 11/14 gitweb: git_is_head_detached() functionGiuseppe Bilotta, Aug 31, 2007
  23. 12/14 gitweb: add HEAD to list of shortlog refs if detachedGiuseppe Bilotta, Aug 31, 2007
  24. 13/14 gitweb: CSS style and refs mark for detached HEADGiuseppe Bilotta, Aug 31, 2007
  25. 14/14 gitweb: minor whitespace cleanupsGiuseppe Bilotta, Aug 31, 2007

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.