From: Eric Wong Date: Sun, 17 Jan 2016 00:32:24 +0000 (+0000) Subject: repobrowse: use 'raw' to link to the /plain/ endpoint X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7d6cea952a3cccfebc679335960c40a5b9d7d729;p=thirdparty%2Fpublic-inbox.git repobrowse: use 'raw' to link to the /plain/ endpoint 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. --- diff --git a/lib/PublicInbox/RepobrowseGitTree.pm b/lib/PublicInbox/RepobrowseGitTree.pm index 7c5ae60de..d499cb4b2 100644 --- a/lib/PublicInbox/RepobrowseGitTree.pm +++ b/lib/PublicInbox/RepobrowseGitTree.pm @@ -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{
path: $t\n\nblob: $hex (plain)};
+	my $h = qq{
path: $t\n\nblob $hex};
 	my $end = '';
 
 	$git->cat_file($hex, sub {
 		my ($cat, $left) = @_; # $$left == $size
+		$h .= qq{\t$$left bytes (raw)};
 		$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
"); return; } - $fh->write($h . '

');
+		$fh->write($h."

");
 		$text_p = 1;
 
 		while (1) {