From 788db1ec53c00b1a1a9457dc156bc7990736e88e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 21 Apr 2014 10:43:59 +0000 Subject: config: use description file for gitweb Do not repeat ourselves, just use the same description file gitweb uses to avoid surprising users. --- lib/PublicInbox/Config.pm | 2 +- lib/PublicInbox/Feed.pm | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/PublicInbox/Config.pm b/lib/PublicInbox/Config.pm index d71bc52e..32bd9ab6 100644 --- a/lib/PublicInbox/Config.pm +++ b/lib/PublicInbox/Config.pm @@ -57,7 +57,7 @@ sub lookup { defined $pfx or return; my %rv; - foreach my $k (qw(mainrepo description address)) { + foreach my $k (qw(mainrepo address)) { my $v = $self->{"$pfx.$k"}; $rv{$k} = $v if defined $v; } diff --git a/lib/PublicInbox/Feed.pm b/lib/PublicInbox/Feed.pm index 4671323c..8cc8b728 100644 --- a/lib/PublicInbox/Feed.pm +++ b/lib/PublicInbox/Feed.pm @@ -200,9 +200,13 @@ sub get_feedopts { my $listname = $args->{listname}; my $cgi = $args->{cgi}; my %rv; + if (open my $fh, '<', "$args->{git_dir}/description") { + chomp($rv{description} = <$fh>); + close $fh; + } if ($pi_config && defined $listname && length $listname) { - foreach my $key (qw(description address)) { + foreach my $key (qw(address)) { $rv{$key} = $pi_config->get($listname, $key) || ""; } } -- cgit v1.2.3-24-ge0c7