From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 560961FA31 for ; Tue, 24 Jan 2023 09:50:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1674553805; bh=hCjj9/jpKCKV5T+jlkFenCeva/OB551x4T8eVjc9xRU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=k1Hp1bFE40KnsTqQOxXKh0yLs9QoqGwdhuKkAnsDoyjYtkzL6ckD5YRWYEhQYjHMW qzNHpfQROFDfrEgZRtqCQ7UVAdxTQAMGGXmLSgN5XbMGgOybzYNvjV4UZPFuTr0jrN xLiAwacDtYbgRg7fwWMYhgXKh6CJk0MnaZlBmYk0= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 07/11] viewvcs: expand on path names being "non-authoritative" Date: Tue, 24 Jan 2023 09:49:36 +0000 Message-Id: <20230124094940.572017-8-e@80x24.org> In-Reply-To: <20230124094940.572017-1-e@80x24.org> References: <20230124094940.572017-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Hopefully this makes sense... --- lib/PublicInbox/ViewVCS.pm | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/lib/PublicInbox/ViewVCS.pm b/lib/PublicInbox/ViewVCS.pm index 60cc1376..0dfe6081 100644 --- a/lib/PublicInbox/ViewVCS.pm +++ b/lib/PublicInbox/ViewVCS.pm @@ -509,11 +509,19 @@ sub solve_result { my $paths = $ctx->{-paths} //= do { my $path = to_filename($fn // 'blob'); my $raw_more = qq[(raw)]; + my @def; # XXX not sure if this is the correct wording - defined($fn) and $raw_more .= -"\nname: ${\ascii_html($fn)} \t # note: path name is non-authoritative"; - [ $path, $raw_more ]; + if (defined($fn)) { + $raw_more .= qq( +name: ${\ascii_html($fn)} \t # note: path name is non-authoritative(*)); + $def[0] = "
" . +'(*) Git path names are given by the tree(s) the blob belongs to. + Blobs themselves have no identifier aside from the hash of its contents.'. +qq(^); + } + [ $path, $raw_more, @def ]; }; $ctx->{-q_value_html} //= do { my $s = defined($fn) ? 'dfn:'.ascii_html($fn).' ' : ''; @@ -547,7 +555,7 @@ sub show_blob { # git->cat_async callback return delete($ctx->{-wcb})->([200, $h, [ $$blob ]]); } - my ($path, $raw_more) = @{delete $ctx->{-paths}}; + my ($path, $raw_more, @def) = @{delete $ctx->{-paths}}; $bin and return html_page($ctx, 200, "
blob $oid $size bytes (binary)" .
 				" $raw_more
".dbg_log($ctx)); @@ -574,7 +582,7 @@ sub show_blob { # git->cat_async callback $x .= '
 
'. # pad for non-CSS users ""; html_page($ctx, 200, $x, $ctx->{-linkify}->linkify_2($$blob), - ''.dbg_log($ctx)); + ''.dbg_log($ctx), @def); } # GET /$INBOX/$GIT_OBJECT_ID/s/