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

[PATCH 1/2] gitweb: Show snapshot links for tree entries in tree listing

From
Petr Baudis <pasky@suse.cz>
Date
Oct 7, 2006, 14:10 UTC
Message-ID
<20061007141040.16912.50717.stgit@rover>
In-Reply-To
<20061007132457.GB20017@pasky.or.cz>

Currently that's inconsistently reachable only by first displaying the tree.

Signed-off-by: Petr Baudis <pasky@suse.cz>
---
 gitweb/gitweb.perl |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index c4970f4..096a01b 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1752,7 +1752,7 @@ sub git_print_simplified_log {
 
 # print tree entry (row of git_tree), but without encompassing <tr> element
 sub git_print_tree_entry {
-	my ($t, $basedir, $hash_base, $have_blame) = @_;
+	my ($t, $basedir, $hash_base, $have_blame, $have_snapshot) = @_;
 
 	my %base_key = ();
 	$base_key{hash_base} = $hash_base if defined $hash_base;
@@ -1798,6 +1798,13 @@ sub git_print_tree_entry {
 			print $cgi->a({-href => href(action=>"history", hash_base=>$hash_base,
 			                             file_name=>"$basedir$t->{'name'}")},
 			              "history");
+			if ($have_snapshot) {
+				print " | ";
+			}
+		}
+		if ($have_snapshot) {
+			print $cgi->a({-href => href(action=>"snapshot", hash=>$t->{'hash'})},
+				      "snapshot");
 		}
 		print "</td>\n";
 	}
@@ -2931,7 +2938,7 @@ sub git_tree {
 		}
 		$alternate ^= 1;
 
-		git_print_tree_entry(\%t, $base, $hash_base, $have_blame);
+		git_print_tree_entry(\%t, $base, $hash_base, $have_blame, $have_snapshot);
 
 		print "</tr>\n";
 	}
Previous: Petr BaudisNext: Luben Tuikov
Message 8 of 54 in “gitweb: Do not print "log" and "shortlog" redundantly in commit view”
  1. gitweb: Do not print "log" and "shortlog" redundantly in commit viewLuben Tuikov, Oct 5, 2006
  2. Jakub NarebskiOct 6, 2006
  3. Petr BaudisOct 6, 2006
  4. Luben TuikovOct 6, 2006
  5. Petr BaudisOct 7, 2006
  6. Jakub NarebskiOct 7, 2006
  7. Petr BaudisOct 7, 2006
  8. 1/2 gitweb: Show snapshot links for tree entries in tree listingPetr Baudis, Oct 7, 2006
  9. Luben TuikovOct 7, 2006
  10. Petr BaudisOct 7, 2006
  11. Luben TuikovOct 7, 2006
  12. Petr BaudisOct 7, 2006
  13. Junio C HamanoOct 7, 2006
  14. Luben TuikovOct 8, 2006
  15. 2/2 gitweb: Show trailing slash when listing tree entry in tree listingPetr Baudis, Oct 7, 2006
  16. Luben TuikovOct 7, 2006
  17. Jakub NarebskiOct 7, 2006
  18. Petr BaudisOct 7, 2006
  19. Jakub NarebskiOct 7, 2006
  20. Petr BaudisOct 7, 2006
  21. Jakub NarebskiOct 7, 2006
  22. Petr BaudisOct 9, 2006
  23. Junio C HamanoOct 9, 2006
  24. Junio C HamanoOct 10, 2006
  25. Luben TuikovOct 10, 2006
  26. Junio C HamanoOct 10, 2006
  27. Luben TuikovOct 10, 2006
  28. Jeff KingOct 10, 2006
  29. Luben TuikovOct 10, 2006
  30. Jeff KingOct 10, 2006
  31. Jakub NarebskiOct 10, 2006
  32. Luben TuikovOct 10, 2006
  33. Junio C HamanoOct 10, 2006
  34. Jakub NarebskiOct 10, 2006
  35. Luben TuikovOct 10, 2006
  36. Jakub NarebskiOct 10, 2006
  37. Luben TuikovOct 10, 2006
  38. Luben TuikovOct 10, 2006
  39. Jakub NarebskiOct 10, 2006
  40. Luben TuikovOct 10, 2006
  41. Jakub NarebskiOct 10, 2006
  42. Jakub NarebskiOct 10, 2006
  43. Andreas EricssonOct 11, 2006
  44. Luben TuikovOct 10, 2006
  45. Jeff KingOct 10, 2006
  46. Andreas EricssonOct 10, 2006
  47. Josef WeidendorferOct 10, 2006
  48. Luben TuikovOct 10, 2006
  49. Josef WeidendorferOct 10, 2006
  50. Luben TuikovOct 10, 2006
  51. Junio C HamanoOct 10, 2006
  52. A Large Angry SCMOct 7, 2006
  53. Junio C HamanoOct 7, 2006
  54. Luben TuikovOct 8, 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.