]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/ViewVCS.pm
www_coderepo: quiet 404s on Atom feeds for dead branches
[public-inbox.git] / lib / PublicInbox / ViewVCS.pm
index 0dfe608191d234e01a357b69e5ca0d082f3158ce..5fd466106f96ae432038c4279bc6c00292c94456 100644 (file)
@@ -409,7 +409,7 @@ EOM
                $pfx = '';
                $$bref .= qq[  (<a href=#path>path</a> unknown)\n];
        }
-       my ($x, $m, $t, $oid, $sz, $f, $n);
+       my ($x, $m, $t, $oid, $sz, $f, $n, $gitlink);
        $$bref .= "\n   size    name";
        for (@ent) {
                ($x, $f) = split(/\t/, $_, 2);
@@ -420,6 +420,7 @@ EOM
                $n = ascii_html($f);
                if ($m eq 'g') { # gitlink submodule commit
                        $$bref .= "\ng\t\t$n @ <a\nhref=#g>commit</a>$oid";
+                       $gitlink = 1;
                        next;
                }
                my $q = 'b='.ascii_html(uri_escape_path($pfx.$f));
@@ -430,17 +431,20 @@ EOM
        }
        $$bref .= dbg_log($ctx);
        $$bref .= <<EOM;
-<pre>glossary
+<hr><pre>glossary
 --------
 <dfn
 id=tree>Tree</dfn> objects belong to commits or other tree objects.  Trees may
-reference blobs, sub-trees, or commits of submodules.
+reference blobs, sub-trees, or (rarely) commits of submodules.
 
 <dfn
 id=path>Path</dfn> names are stored in tree objects, but trees do not know
 their own path name.  A tree's path name comes from their parent tree,
 or it is the root tree referenced by a commit object.  Thus, this web UI
 relies on the `b=' URI parameter as a hint to display the path name.
+EOM
+
+       $$bref .= <<EOM if $gitlink;
 
 <dfn title="submodule commit"
 id=g>Commit</dfn> objects may be stored in trees to reference submodules.</pre>
@@ -497,8 +501,9 @@ sub show_tag ($$) {
 sub solve_result {
        my ($res, $ctx) = @_;
        my $hints = delete $ctx->{hints};
-       $res or return html_page($ctx, 404, dbg_log($ctx));
-       ref($res) eq 'ARRAY' or return html_page($ctx, 500, dbg_log($ctx));
+       $res or return html_page($ctx, 404, 'Not found', dbg_log($ctx));
+       ref($res) eq 'ARRAY' or
+               return html_page($ctx, 500, 'Internal error', dbg_log($ctx));
 
        my ($git, $oid, $type, $size, $di) = @$res;
        return show_commit($ctx, $res) if $type eq 'commit';