Do not repeat ourselves, just use the same description file
gitweb uses to avoid surprising users.
address = sandbox@public-inbox.org
address = test@public-inbox.org
mainrepo = /home/pi/test-main.git
address = sandbox@public-inbox.org
address = test@public-inbox.org
mainrepo = /home/pi/test-main.git
- description = test/sandbox area, occasionally reset
url = http://example.com/test
[publicinbox "meta"]
address = meta@public-inbox.org
mainrepo = /home/pi/meta-main.git
url = http://example.com/test
[publicinbox "meta"]
address = meta@public-inbox.org
mainrepo = /home/pi/meta-main.git
- description = development discussion
url = http://example.com/meta
atomUrl = http://example.com/meta
url = http://example.com/meta
atomUrl = http://example.com/meta
defined $pfx or return;
my %rv;
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;
}
my $v = $self->{"$pfx.$k"};
$rv{$k} = $v if defined $v;
}
my $listname = $args->{listname};
my $cgi = $args->{cgi};
my %rv;
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) {
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) || "";
}
}
$rv{$key} = $pi_config->get($listname, $key) || "";
}
}
is(1, mkdir($pi_home, 0755), "setup ~/.public-inbox");
is(0, system(qw(git init -q --bare), $maindir), "git init (main)");
is(1, mkdir($pi_home, 0755), "setup ~/.public-inbox");
is(0, system(qw(git init -q --bare), $maindir), "git init (main)");
+ open my $fh, '>', "$maindir/description" or die "open: $!\n";
+ print $fh "test for public-inbox\n";
+ close $fh or die "close: $!\n";
my %cfg = (
"$cfgpfx.address" => $addr,
"$cfgpfx.mainrepo" => $maindir,
my %cfg = (
"$cfgpfx.address" => $addr,
"$cfgpfx.mainrepo" => $maindir,
- "$cfgpfx.description" => 'test for public-inbox',
);
while (my ($k,$v) = each %cfg) {
is(0, system(qw(git config --file), $pi_config, $k, $v),
);
while (my ($k,$v) = each %cfg) {
is(0, system(qw(git config --file), $pi_config, $k, $v),
'mainrepo' => '/home/pi/meta-main.git',
'address' => 'meta@public-inbox.org',
-primary_address => 'meta@public-inbox.org',
'mainrepo' => '/home/pi/meta-main.git',
'address' => 'meta@public-inbox.org',
-primary_address => 'meta@public-inbox.org',
- 'description' => 'development discussion',
'listname' => 'meta',
}, "lookup matches expected output");
'listname' => 'meta',
}, "lookup matches expected output");
'test@public-inbox.org'],
-primary_address => 'try@public-inbox.org',
'mainrepo' => '/home/pi/test-main.git',
'test@public-inbox.org'],
-primary_address => 'try@public-inbox.org',
'mainrepo' => '/home/pi/test-main.git',
- 'description' => 'test/sandbox area, occasionally reset',
'listname' => 'test',
}, "lookup matches expected output for test");
}
'listname' => 'test',
}, "lookup matches expected output for test");
}