Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Baudis <pasky@suse.cz>2006-10-24 07:23:46 +0400
committerJunio C Hamano <junkio@cox.net>2006-10-24 07:55:44 +0400
commit447ef09a5cf98bea28ec5123b968c966afce5772 (patch)
treea8f64051b0badebdaf9f49f96c589b734e294b3b
parent8be2890c994102d5748342f44bd6353bd482b58b (diff)
gitweb: Show project's README.html if available
If the repository includes a README.html file, show it in the summary page. The usual "this should be in the config file" argument does not apply here since this can be larger and having such a big string in the config file would be impractical. I don't know if this is suitable upstream, but it's one of the repo.or.cz custom modifications that I've thought could be interesting for others as well. Compared to the previous patch, this adds the '.html' extension to the filename, so that it's clear it is, well, HTML. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
-rwxr-xr-xgitweb/gitweb.perl8
1 files changed, 8 insertions, 0 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 604780650b..a201043dd3 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -2530,6 +2530,14 @@ sub git_summary {
}
print "</table>\n";
+ if (-s "$projectroot/$project/README.html") {
+ if (open my $fd, "$projectroot/$project/README.html") {
+ print "<div class=\"title\">readme</div>\n";
+ print $_ while (<$fd>);
+ close $fd;
+ }
+ }
+
open my $fd, "-|", git_cmd(), "rev-list", "--max-count=17",
git_get_head_hash($project)
or die_error(undef, "Open git-rev-list failed");