]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
repobrowse: use 'raw' to link to the /plain/ endpoint
authorEric Wong <e@80x24.org>
Sun, 17 Jan 2016 00:32:24 +0000 (00:32 +0000)
committerEric Wong <e@80x24.org>
Tue, 5 Apr 2016 18:58:27 +0000 (18:58 +0000)
We use 'raw' in the rest of public-inbox to resolve the raw,
unformatted message (as does gmane and gitweb), so don't expose
the word 'plain' to users which only cgit seems to use.

lib/PublicInbox/RepobrowseGitTree.pm

index 7c5ae60dea58b170baa281dc309a3a25fdc38430..d499cb4b2f99c9b64aa88d6667b40479a940f7c7 100644 (file)
@@ -14,7 +14,7 @@ my %GIT_MODE = (
        '160000' => 'g', # commit (gitlink)
 );
 
-my $BINARY_MSG = "Binary file, save using the 'plain' link above";
+my $BINARY_MSG = "Binary file, save using the 'raw' link above";
 
 sub git_tree_stream {
        my ($self, $req, $res) = @_; # res: Plack callback
@@ -87,11 +87,12 @@ sub git_blob_show {
        my $plain = join('/', "${rel}plain", @{$req->{extra}});
        $plain = PublicInbox::Hval->utf8($plain)->as_path . $q->qs;
        my $t = cur_path($req, $q);
-       my $h = qq{<pre>path: $t\n\nblob: $hex (<a\nhref="$plain">plain</a>)};
+       my $h = qq{<pre>path: $t\n\nblob $hex};
        my $end = '';
 
        $git->cat_file($hex, sub {
                my ($cat, $left) = @_; # $$left == $size
+               $h .= qq{\t$$left bytes (<a\nhref="$plain">raw</a>)};
                $to_read = $$left if $to_read > $$left;
                my $r = read($cat, my $buf, $to_read);
                return unless defined($r) && $r > 0;
@@ -101,7 +102,7 @@ sub git_blob_show {
                        $fh->write("$h\n$BINARY_MSG</pre>");
                        return;
                }
-               $fh->write($h . '</pre><hr/><table><tr><td><pre>');
+               $fh->write($h."</pre><hr/><table\nsummary=blob><tr><td><pre>");
                $text_p = 1;
 
                while (1) {