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

[PATCH] gitweb: tree view: eliminate redundant "blob"

From
LTLuben Tuikov <ltuikov@yahoo.com>
Date
Sep 26, 2006, 05:38 UTC
Message-ID
<20060926053816.54951.qmail@web31815.mail.mud.yahoo.com>
Binary and non-binary blobs:

The "list" table element of tree view is identical to the "blob" link part of the link table element. I.e. clicking on "blob" is identical to clicking on the entry itself.

Thus, eliminate "blob" from being shown -- the user can get identical result by simply clicking on the entry itself.

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
---
 gitweb/gitweb.perl |   33 +++++++++++++++++----------------
 1 files changed, 17 insertions(+), 16 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 66be619..c7ab3b6 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1600,34 +1600,35 @@ sub git_print_tree_entry {
 	my %base_key = ();
 	$base_key{hash_base} = $hash_base if defined $hash_base;
 
+	# The format of a table row is: mode list link.  Where mode is
+	# the mode of the entry, list is the name of the entry, an href,
+	# and link is the action links of the entry.
+
 	print "<td class=\"mode\">" . mode_str($t->{'mode'}) . "</td>\n";
 	if ($t->{'type'} eq "blob") {
 		print "<td class=\"list\">" .
-		      $cgi->a({-href => href(action=>"blob", hash=>$t->{'hash'},
-		                             file_name=>"$basedir$t->{'name'}", %base_key),
-		              -class => "list"}, esc_html($t->{'name'})) .
-		      "</td>\n" .
-		      "<td class=\"link\">" .
-		      $cgi->a({-href => href(action=>"blob", hash=>$t->{'hash'},
-		                             file_name=>"$basedir$t->{'name'}", %base_key)},
-		              "blob");
+			$cgi->a({-href => href(action=>"blob", hash=>$t->{'hash'},
+					       file_name=>"$basedir$t->{'name'}", %base_key),
+				 -class => "list"}, esc_html($t->{'name'})) . "</td>\n";
+		print "<td class=\"link\">";
 		if ($have_blame) {
-			print " | " .
-				$cgi->a({-href => href(action=>"blame", hash=>$t->{'hash'},
-				                       file_name=>"$basedir$t->{'name'}", %base_key)},
-				        "blame");
+			print $cgi->a({-href => href(action=>"blame", hash=>$t->{'hash'},
+						     file_name=>"$basedir$t->{'name'}", %base_key)},
+				      "blame");
 		}
 		if (defined $hash_base) {
-			print " | " .
-			      $cgi->a({-href => href(action=>"history", hash_base=>$hash_base,
+			if ($have_blame) {
+				print " | ";
+			}
+			print $cgi->a({-href => href(action=>"history", hash_base=>$hash_base,
 			                             hash=>$t->{'hash'}, file_name=>"$basedir$t->{'name'}")},
 			              "history");
 		}
 		print " | " .
 		      $cgi->a({-href => href(action=>"blob_plain",
 		                             hash=>$t->{'hash'}, file_name=>"$basedir$t->{'name'}")},
-		              "raw") .
-		      "</td>\n";
+		              "raw");
+		print "</td>\n";
 
 	} elsif ($t->{'type'} eq "tree") {
 		print "<td class=\"list\">" .
-- 
1.4.2.1.gdbbb
Next: Junio C Hamano
Message 1 of 33 in “gitweb: tree view: eliminate redundant "blob"”
  1. gitweb: tree view: eliminate redundant "blob"Luben Tuikov, Sep 26, 2006
  2. Junio C HamanoSep 26, 2006
  3. Luben TuikovSep 26, 2006
  4. Jakub NarebskiSep 26, 2006
  5. Jakub NarebskiSep 26, 2006
  6. Petr BaudisSep 26, 2006
  7. Jakub NarebskiSep 26, 2006
  8. Luben TuikovSep 26, 2006
  9. Junio C HamanoSep 27, 2006
  10. Jakub NarebskiOct 1, 2006
  11. Luben TuikovSep 26, 2006
  12. Jakub NarebskiSep 26, 2006
  13. Luben TuikovSep 26, 2006
  14. Jakub NarebskiSep 26, 2006
  15. Jakub NarebskiSep 26, 2006
  16. Junio C HamanoSep 27, 2006
  17. Jakub NarebskiOct 1, 2006
  18. Junio C HamanoOct 1, 2006
  19. Jakub NarebskiOct 1, 2006
  20. Andreas EricssonOct 2, 2006
  21. Jakub NarebskiOct 2, 2006
  22. Junio C HamanoOct 2, 2006
  23. Jakub NarebskiOct 2, 2006
  24. Luben TuikovOct 2, 2006
  25. Luben TuikovOct 2, 2006
  26. Jakub NarebskiOct 2, 2006
  27. Junio C HamanoOct 3, 2006
  28. Jakub NarebskiOct 3, 2006
  29. Junio C HamanoOct 3, 2006
  30. Jakub NarebskiOct 3, 2006
  31. Luben TuikovOct 5, 2006
  32. Luben TuikovOct 3, 2006
  33. Linus TorvaldsOct 3, 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.