From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id C9BF01F62A for ; Mon, 29 Aug 2022 09:26:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1661765209; bh=qAmNBR/C8YS2OmAwXqPSM/GVmZ+bpSdbpVuirUXEjYQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Lb99M8G5vEAdJ7YDClwWS1uFXzrcz0pe7uKNvUsbkqhUMd6wk66asczln8EWjNYaE zTDjo85fhRTkkZb4pOR6TYqxXx7Z4FU4TS/cWxeU+EX3C+2fgbIl6tkOw2lKlbs8BW 9mMo05yL3VR4KfJo1Iu2GyxEnhORziY9sbtFJO8g= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 18/18] viewvcs: show "blob $OID" rather than "$OID blob" Date: Mon, 29 Aug 2022 09:26:47 +0000 Message-Id: <20220829092647.1512215-19-e@80x24.org> In-Reply-To: <20220829092647.1512215-1-e@80x24.org> References: <20220829092647.1512215-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: This is more consistent with the rest of the output where it's "$TYPE $OID" rather than "$OID $TYPE". The former also allows easy copy+pasting into commands for both "git cat-file blob $OID" and "lei blob $OID". --- lib/PublicInbox/ViewVCS.pm | 6 +++--- t/solver_git.t | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/PublicInbox/ViewVCS.pm b/lib/PublicInbox/ViewVCS.pm index 4c4cf3b3..8800afcb 100644 --- a/lib/PublicInbox/ViewVCS.pm +++ b/lib/PublicInbox/ViewVCS.pm @@ -414,7 +414,7 @@ sub solve_result { return stream_large_blob($ctx, $res) if defined $ctx->{fn}; return html_page($ctx, 200, <Too big to show, download available -"$oid $type $size bytes $raw_link +blob $oid $size bytes $raw_link EOM } @@ -433,7 +433,7 @@ EOM } $bin and return html_page($ctx, 200, - "
$oid $type $size bytes (binary)" .
+				"
blob $oid $size bytes (binary)" .
 				" $raw_link
".dbg_log($ctx)); # TODO: detect + convert to ensure validity @@ -449,7 +449,7 @@ EOM $$blob = ascii_html($$blob); } - my $x = "
$oid $type $size bytes $raw_link
" . + my $x = "
blob $oid $size bytes $raw_link
" . "
". "
";
 	$x .= sprintf("% ${pad}u\n", $_) for (1..$nl);
diff --git a/t/solver_git.t b/t/solver_git.t
index 5c7bfa28..958af065 100644
--- a/t/solver_git.t
+++ b/t/solver_git.t
@@ -287,7 +287,8 @@ EOF
 		while (my ($label, $size) = each %bin) {
 			$res = $cb->(GET("/$name/$oid{$label}/s/"));
 			is($res->code, 200, "$label binary file");
-			ok(index($res->content, "blob $size bytes") >= 0,
+			ok(index($res->content,
+				"blob $oid{$label} $size bytes") >= 0,
 				"showed $label binary blob size");
 			$res = $cb->(GET("/$name/$oid{$label}/s/raw"));
 			is($res->code, 200, "$label raw binary download");