]> git.ipfire.org Git - thirdparty/git.git/commitdiff
gitweb: configurable home link string
authorYasushi SHOJI <yashi@atmark-techno.com>
Mon, 14 Aug 2006 22:50:49 +0000 (07:50 +0900)
committerJunio C Hamano <junkio@cox.net>
Tue, 15 Aug 2006 01:09:33 +0000 (18:09 -0700)
I've always found difficult to figure out git URL for clone from
gitweb URL because git:// and http:// are different on many site
including kernel.org.

I've found this enhancement at http://dev.laptop.org/git when I was on
git channel, and thought that it'd be nice if all public gitweb site
show it's git URL on its page.

This patch allow us to change the home link string.  The current
default is "projects" as we all see on gitweb now.

ie. kernel.org might set this variable to "git://git.kernel.org/pub/scm/"

Signed-off-by: Yasushi SHOJI <yashi@atmark-techno.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Makefile
gitweb/gitweb.perl

index a538710ed6b53079f85582c83be11ae414380d15..b363f50d4841149ebe6116275011590cf522fac3 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -123,6 +123,7 @@ GIT_PYTHON_DIR = $(prefix)/share/git-core/python
 
 # default configuration for gitweb
 GITWEB_CONFIG = gitweb_config.perl
+GITWEB_HOME_LINK_STR = projects
 GITWEB_SITENAME =
 GITWEB_PROJECTROOT = /pub/git
 GITWEB_LIST =
@@ -617,6 +618,7 @@ gitweb/gitweb.cgi: gitweb/gitweb.perl
            -e 's|++GIT_VERSION++|$(GIT_VERSION)|g' \
            -e 's|++GIT_BINDIR++|$(bindir)|g' \
            -e 's|++GITWEB_CONFIG++|$(GITWEB_CONFIG)|g' \
+           -e 's|++GITWEB_HOME_LINK_STR++|$(GITWEB_HOME_LINK_STR)|g' \
            -e 's|++GITWEB_SITENAME++|$(GITWEB_SITENAME)|g' \
            -e 's|++GITWEB_PROJECTROOT++|$(GITWEB_PROJECTROOT)|g' \
            -e 's|++GITWEB_LIST++|$(GITWEB_LIST)|g' \
index ab28caa8c8ef1c24c69affe48080aa75d564ae45..b5b89de91bc13a4a96b97b72437de126b5bc7274 100755 (executable)
@@ -36,6 +36,9 @@ our $git_temp = "/tmp/gitweb";
 # target of the home link on top of all pages
 our $home_link = $my_uri;
 
+# string of the home link on top of all pages
+our $home_link_str = "++GITWEB_HOME_LINK_STR++";
+
 # name of your site or organization to appear in page titles
 # replace this with something more descriptive for clearer bookmarks
 our $site_name = "++GITWEB_SITENAME++" || $ENV{'SERVER_NAME'} || "Untitled";
@@ -974,7 +977,7 @@ EOF
              "<a href=\"http://www.kernel.org/pub/software/scm/git/docs/\" title=\"git documentation\">" .
              "<img src=\"$logo\" width=\"72\" height=\"27\" alt=\"git\" style=\"float:right; border-width:0px;\"/>" .
              "</a>\n";
-       print $cgi->a({-href => esc_param($home_link)}, "projects") . " / ";
+       print $cgi->a({-href => esc_param($home_link)}, $home_link_str) . " / ";
        if (defined $project) {
                print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=summary")}, esc_html($project));
                if (defined $action) {