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

[PATCH] gitweb: Support multiple clone urls

From
Aneesh Kumar K.V <aneesh.kumar@gmail.com>
Date
Aug 15, 2006, 17:23 UTC
Message-ID
<ebsvuq$de5$1@sea.gmane.org>
In-Reply-To
<1155659063.10054.65.camel@cashmere.sps.mot.com>
This one is on top of the last one 
>From 135f502d7f47f58be5035f2cdb4896dd24adb852 Mon Sep 17 00:00:00 2001
gitweb: Support multiple clone urls
This shows multiple urls if available for git clone
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
---
 gitweb/gitweb.perl |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 869c53e..501537f 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -505,12 +505,13 @@ sub git_get_project_description {
 
 sub git_get_project_cloneurl {
 	my $path = shift;
+	my @cloneurls;
 
 	open my $fd, "$projectroot/$path/cloneurl" or return undef;
-	my $descr = <$fd>;
+	@cloneurls = <$fd>;
 	close $fd;
-	chomp $descr;
-	return $descr;
+
+	return \@cloneurls;
 }
 
 sub git_get_projects_list {
@@ -1665,7 +1666,7 @@ sub git_project_list {
 sub git_summary {
 	my $descr = git_get_project_description($project) || "none";
 	my $head = git_get_head_hash($project);
-	my $cloneurl = git_get_project_cloneurl($project) || "none";
+	my $cloneurls = git_get_project_cloneurl($project);
 	my %co = parse_commit($head);
 	my %cd = parse_date($co{'committer_epoch'}, $co{'committer_tz'});
 
@@ -1679,9 +1680,14 @@ sub git_summary {
 	print "<table cellspacing=\"0\">\n" .
 	      "<tr><td>description</td><td>" . esc_html($descr) . "</td></tr>\n" .
 	      "<tr><td>owner</td><td>$owner</td></tr>\n" .
-	      "<tr><td>last change</td><td>$cd{'rfc2822'}</td></tr>\n" .
-	      "<tr><td>URL</td><td>$cloneurl</td></tr>\n" .
-	      "</table>\n";
+	      "<tr><td>last change</td><td>$cd{'rfc2822'}</td></tr>\n";
+
+	my $url;
+	foreach $url (@$cloneurls) {
+		chomp $url;
+		print "<tr><td>URL</td><td>$url</td></tr>\n";
+	}
+	print "</table>\n";
 
 	open my $fd, "-|", $GIT, "rev-list", "--max-count=17", git_get_head_hash($project)
 		or die_error(undef, "Open git-rev-list failed");
-- 
1.4.2.rc1.g83e1-dirty
Previous: Jon Loeliger
Message 4 of 4 in “A better way to inform about git clone url. [2de21fac9842650fceb3db68f15711e38fabc3c8]”
  1. Aneesh Kumar K.VAug 15, 2006
  2. gitweb: Add support for cloneurl.Aneesh Kumar K.V, Aug 15, 2006
  3. Jon LoeligerAug 15, 2006
  4. gitweb: Support multiple clone urlsAneesh Kumar K.V, Aug 15, 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.