aboutsummaryrefslogtreecommitdiff
path: root/gitweb
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-10-06 00:16:05 -0700
committerJunio C Hamano <junkio@cox.net>2006-10-06 00:16:05 -0700
commit4b4a5dbb17e1136275665024689625ed5cc5a03d (patch)
tree5962c8c82b5a8c492c42c90c9b959c39970d0124 /gitweb
parentb2d3476e15cefdbd94366d4cf46fd05c1623034f (diff)
parentb5c698d947c236559e338e45c6234ece7c819338 (diff)
downloadgit-4b4a5dbb17e1136275665024689625ed5cc5a03d.tar.gz
git-4b4a5dbb17e1136275665024689625ed5cc5a03d.tar.xz
Merge branch 'jc/blame' into jc/web-blame
* jc/blame: git-blame --porcelain blame.c: move code to output metainfo into a separate function. git-blame: --show-number (and -n) git-blame: --show-name (and -f) blame.c: whitespace and formatting clean-up. gitweb: Make the Git logo link target to point to the homepage gitweb: blame: Minimize vertical table row padding gitweb: Do not print "log" and "shortlog" redundantly in commit view vc-git.el: Switch to using git-blame instead of git-annotate. git.el: Fixed inverted "renamed from/to" message. tar-tree deprecation: we eat our own dog food. Add git-upload-archive to the main git man page git-commit: cleanup unused function. Fix usage string to match that given in the man page Update the gitweb/README file to include setting the GITWEB_CONFIG environment Conflicts: gitweb/gitweb.perl
Diffstat (limited to 'gitweb')
-rw-r--r--gitweb/README7
-rw-r--r--gitweb/gitweb.css6
-rwxr-xr-xgitweb/gitweb.perl21
3 files changed, 25 insertions, 9 deletions
diff --git a/gitweb/README b/gitweb/README
index 61c7ab5d4..78e6fc05f 100644
--- a/gitweb/README
+++ b/gitweb/README
@@ -43,6 +43,7 @@ repositories, you can configure apache like this:
DocumentRoot /pub/git
RewriteEngine on
RewriteRule ^/(.*\.git/(?!/?(info|objects|refs)).*)?$ /cgi-bin/gitweb.cgi%{REQUEST_URI} [L,PT]
+ SetEnv GITWEB_CONFIG /etc/gitweb.conf
</VirtualHost>
The above configuration expects your public repositories to live under
@@ -51,6 +52,12 @@ both as cloneable GIT URL and as browseable gitweb interface.
If you then start your git-daemon with --base-path=/pub/git --export-all
then you can even use the git:// URL with exactly the same path.
+Setting the environment variable GITWEB_CONFIG will tell gitweb to use
+the named file (i.e. in this example /etc/gitweb.conf) as a
+configuration for gitweb. Perl variables defined in here will
+override the defaults given at the head of the gitweb.perl (or
+gitweb.cgi). Look at the comments in that file for information on
+which variables and what they mean.
Originally written by:
diff --git a/gitweb/gitweb.css b/gitweb/gitweb.css
index eb9fc3804..668e69af1 100644
--- a/gitweb/gitweb.css
+++ b/gitweb/gitweb.css
@@ -173,6 +173,12 @@ table.blame {
border-collapse: collapse;
}
+table.blame td {
+ padding: 0px 5px;
+ font-size: 12px;
+ vertical-align: top;
+}
+
th {
padding: 2px 5px;
font-size: 12px;
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index e4ebce622..0ac05cc71 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -59,6 +59,9 @@ our $logo = "++GITWEB_LOGO++";
# URI of GIT favicon, assumed to be image/png type
our $favicon = "++GITWEB_FAVICON++";
+our $githelp_url = "http://git.or.cz/";
+our $githelp_label = "git homepage";
+
# source of projects list
our $projects_list = "++GITWEB_LIST++";
@@ -1411,7 +1414,9 @@ EOF
}
print "<div class=\"page_header\">\n" .
- "<a href=\"http://www.kernel.org/pub/software/scm/git/docs/\" title=\"git documentation\">" .
+ "<a href=\"" . esc_html($githelp_url) .
+ "\" title=\"" . esc_html($githelp_label) .
+ "\">" .
"<img src=\"$logo\" width=\"72\" height=\"27\" alt=\"git\" style=\"float:right; border-width:0px;\"/>" .
"</a>\n";
print $cgi->a({-href => esc_url($home_link)}, $home_link_str) . " / ";
@@ -2891,9 +2896,12 @@ sub git_snapshot {
-content_disposition => 'inline; filename="' . "$filename" . '"',
-status => '200 OK');
- my $git_command = git_cmd_str();
- open my $fd, "-|", "$git_command tar-tree $hash \'$project\' | $command" or
- die_error(undef, "Execute git-tar-tree failed.");
+ my $git = git_cmd_str();
+ my $name = $project;
+ $name =~ s/\047/\047\\\047\047/g;
+ open my $fd, "-|",
+ "$git archive --format=tar --prefix=\'$name\'/ $hash | $command"
+ or die_error(undef, "Execute git-tar-tree failed.");
binmode STDOUT, ':raw';
print <$fd>;
binmode STDOUT, ':utf8'; # as set at the beginning of gitweb.cgi
@@ -2990,11 +2998,6 @@ sub git_commit {
$cgi->a({-href => href(action=>"blame", hash_parent=>$parent, file_name=>$file_name)},
"blame");
}
- if (defined $co{'parent'}) {
- push @views_nav,
- $cgi->a({-href => href(action=>"shortlog", hash=>$hash)}, "shortlog"),
- $cgi->a({-href => href(action=>"log", hash=>$hash)}, "log");
- }
git_header_html(undef, $expires);
git_print_page_nav('commit', defined $co{'parent'} ? '' : 'commitdiff',
$hash, $co{'tree'}, $hash,