]> Sergey Matveev's repositories - public-inbox.git/blobdiff - public-inbox.cgi
config: use description file for gitweb
[public-inbox.git] / public-inbox.cgi
index 31d521334d9f2a8d684bce0840358f01b6375530..33313bf55dd2b549bacd14413874e08e0701e87d 100755 (executable)
@@ -16,7 +16,6 @@ use CGI qw(:cgi :escapeHTML -nosticky); # PSGI/FastCGI/mod_perl compat
 use Encode qw(decode_utf8);
 use PublicInbox::Config;
 use URI::Escape qw(uri_escape uri_unescape);
-use Digest::SHA qw(sha1_hex);
 our $LISTNAME_RE = qr!\A/([\w\.\-]+)!;
 our $pi_config;
 BEGIN {
@@ -65,12 +64,8 @@ sub main {
        } elsif ($path_info =~ m!$LISTNAME_RE\z!o) {
                invalid_list(\%ctx, $1) || redirect_list_index(\%ctx, $cgi);
        } elsif ($path_info =~ m!$LISTNAME_RE(?:/|/index\.html)?\z!o) {
-               invalid_list(\%ctx, $1) || get_index(\%ctx, $cgi, 1);
-       } elsif ($path_info =~ m!$LISTNAME_RE/(?:all\.html)?\z!o) {
                invalid_list(\%ctx, $1) || get_index(\%ctx, $cgi, 0);
-       } elsif ($path_info =~ m!$LISTNAME_RE/index\.atom\.xml\z!o) {
-               invalid_list(\%ctx, $1) || get_atom(\%ctx, $cgi, 1);
-       } elsif ($path_info =~ m!$LISTNAME_RE/all\.atom\.xml\z!o) {
+       } elsif ($path_info =~ m!$LISTNAME_RE/atom\.xml\z!o) {
                invalid_list(\%ctx, $1) || get_atom(\%ctx, $cgi, 0);
 
        # single-message pages
@@ -117,8 +112,7 @@ sub invalid_list_mid {
        undef;
 }
 
-# /$LISTNAME/index.atom.xml                     -> Atom feed
-# /$LISTNAME/all.atom.xml                       -> Atom feed, includes replies
+# /$LISTNAME/atom.xml                       -> Atom feed, includes replies
 sub get_atom {
        my ($ctx, $cgi, $top) = @_;
        require PublicInbox::Feed;
@@ -133,7 +127,7 @@ sub get_atom {
        ];
 }
 
-# /$LISTNAME/?before=$GIT_COMMIT                 -> HTML only
+# /$LISTNAME/?r=$GIT_COMMIT                 -> HTML only
 sub get_index {
        my ($ctx, $cgi, $top) = @_;
        require PublicInbox::Feed;
@@ -152,7 +146,8 @@ sub get_index {
 sub mid2blob {
        my ($ctx) = @_;
        local $ENV{GIT_DIR} = $ctx->{git_dir};
-       my $hex = sha1_hex($ctx->{mid});
+       require Digest::SHA;
+       my $hex = Digest::SHA::sha1_hex($ctx->{mid});
        $hex =~ /\A([a-f0-9]{2})([a-f0-9]{38})\z/i or
                        die "BUG: not a SHA-1 hex: $hex";
        my $blob = `git cat-file blob HEAD:$1/$2 2>/dev/null`;