From d03f31da89d568fa04c439bf9610c62348597e44 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 24 Jan 2023 09:49:36 +0000 Subject: viewvcs: expand on path names being "non-authoritative" 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/ -- cgit v1.2.3-24-ge0c7