about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-01-24 09:49:36 +0000
committerEric Wong <e@80x24.org>2023-01-24 10:07:54 +0000
commitd03f31da89d568fa04c439bf9610c62348597e44 (patch)
treeab5b0cde7949cead33c336d886e0fba2d14bae6b
parent69ff4be6e7c8257834815dbdc0a2fd3563f6f350 (diff)
downloadpublic-inbox-d03f31da89d568fa04c439bf9610c62348597e44.tar.gz
Hopefully this makes sense...
-rw-r--r--lib/PublicInbox/ViewVCS.pm18
1 files 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[(<a\nhref="$path">raw</a>)];
+                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<a
+href="#pathdef" id=top>(*)</a>);
+                        $def[0] = "<hr><pre\nid=pathdef>" .
+'(*) 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(<a\nhref="#top">^</a></pre>);
+                }
+                [ $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,
                                 "<pre>blob $oid $size bytes (binary)" .
                                 " $raw_more</pre>".dbg_log($ctx));
@@ -574,7 +582,7 @@ sub show_blob { # git->cat_async callback
         $x .= '</pre></td><td><pre> </pre></td>'. # pad for non-CSS users
                 "<td\nclass=lines><pre\nstyle='white-space:pre'><code>";
         html_page($ctx, 200, $x, $ctx->{-linkify}->linkify_2($$blob),
-                '</code></pre></td></tr></table>'.dbg_log($ctx));
+                '</code></pre></td></tr></table>'.dbg_log($ctx), @def);
 }
 
 # GET /$INBOX/$GIT_OBJECT_ID/s/