aboutsummaryrefslogtreecommitdiff
path: root/gitweb
diff options
context:
space:
mode:
authorJakub Narebski <jnareb@gmail.com>2006-08-15 23:03:17 +0200
committerJunio C Hamano <junkio@cox.net>2006-08-15 21:54:26 -0700
commit19a8721ef8f82153fee93c62bd050659cf718d6d (patch)
treeeb4f52108137b23fef93e092939035530f050051 /gitweb
parent96f1e58f524fac8607cfc38896b365b6e8365b51 (diff)
downloadgit-19a8721ef8f82153fee93c62bd050659cf718d6d.tar.gz
git-19a8721ef8f82153fee93c62bd050659cf718d6d.tar.xz
gitweb: Show project's git URL on summary page
From 31e4de9f22a3b17d4ad0ac800132e4e1a0a15006 Mon Sep 17 00:00:00 2001 From: David Rientjes <rientjes@google.com> Date: Tue, 15 Aug 2006 11:43:04 -0700 Subject: [PATCH] gitweb: Show project's git URL on summary page Add support for showing multiple clone/fetch git URLs for project on a summary page. URL for project is created from base URL and project name. For example for XMMS2 project (xmms.se) the git base URL would be git://git.xmms.se/xmms2. With corrections from David Rientjes <rientjes@google.com> Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: David Rientjes <rientjes@google.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'gitweb')
-rwxr-xr-xgitweb/gitweb.perl14
1 files changed, 12 insertions, 2 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index b5b89de91..0e1de297e 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -54,6 +54,10 @@ our $logo = "++GITWEB_LOGO++";
# source of projects list
our $projects_list = "++GITWEB_LIST++";
+# list of git base URLs used for URL to where fetch project from,
+# i.e. full URL is "$git_base_url/$project"
+our @git_base_url_list = ("++GITWEB_BASE_URL++");
+
# default blob_plain mimetype and default charset for text/plain blob
our $default_blob_plain_mimetype = 'text/plain';
our $default_text_plain_charset = undef;
@@ -1668,8 +1672,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" .
- "</table>\n";
+ "<tr><td>last change</td><td>$cd{'rfc2822'}</td></tr>\n";
+ my $url_tag = "URL";
+ foreach my $git_base_url (@git_base_url_list) {
+ next unless $git_base_url;
+ print "<tr><td>$url_tag</td><td>$git_base_url/$project</td></tr>\n";
+ $url_tag = "";
+ }
+ 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");