git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gitweb: Show project README if available
@ 2006-10-10  2:56 Petr Baudis
  2006-10-10  3:20 ` Junio C Hamano
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Petr Baudis @ 2006-10-10  2:56 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

If the project includes a README 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.

Signed-off-by: Petr Baudis <pasky@suse.cz>
---

 gitweb/gitweb.perl |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 7547c4d..4e56af9 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -2535,6 +2535,14 @@ sub git_summary {
 	}
 	print "</table>\n";
 
+	if (-s "$projectroot/$project/README") {
+		if (open my $fd, "$projectroot/$project/README") {
+			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");

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2006-10-11 20:42 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-10  2:56 [PATCH] gitweb: Show project README if available Petr Baudis
2006-10-10  3:20 ` Junio C Hamano
2006-10-10  4:33   ` Junio C Hamano
2006-10-10 10:55     ` Petr Baudis
2006-10-10 11:21       ` Jakub Narebski
2006-10-10 14:25     ` Horst H. von Brand
2006-10-10  5:15 ` Luben Tuikov
2006-10-10  8:33   ` Andreas Ericsson
2006-10-10  9:00 ` Jakub Narebski
2006-10-10 10:41   ` Petr Baudis
2006-10-11 12:23     ` Jakub Narebski
2006-10-11 18:17       ` Jeff King
2006-10-11 18:46         ` Jakub Narebski
2006-10-11 19:32           ` Junio C Hamano
2006-10-11 20:33             ` Jakub Narebski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).