From: Petr Baudis Date: Tue, 24 Oct 2006 03:23:46 +0000 (+0200) Subject: gitweb: Show project's README.html if available X-Git-Tag: v1.4.4-rc1~67^2~3 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=447ef09a5cf98bea28ec5123b968c966afce5772;p=git.git 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 Signed-off-by: Junio C Hamano --- diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 604780650..a201043dd 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -2530,6 +2530,14 @@ sub git_summary { } print "\n"; + if (-s "$projectroot/$project/README.html") { + if (open my $fd, "$projectroot/$project/README.html") { + print "
readme
\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");