From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH] viewvcs: fix b= generation in $REPO/tree/ listing
Date: Tue, 24 Sep 2024 18:35:48 +0000 [thread overview]
Message-ID: <20240924183548.509216-1-e@80x24.org> (raw)
Queries such as `b=contrib/cssREADME' are incorrect despite
having the actual blob OID for the given file. Add a trailing
for files in a project subdirectory in those cases as we do
for cases we don't have a known path name.
While we're in the area, avoid needless shadowing of the `$t'
var and add a comment to describe its contents.
---
lib/PublicInbox/ViewVCS.pm | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/PublicInbox/ViewVCS.pm b/lib/PublicInbox/ViewVCS.pm
index 3e604901..e556a0e2 100644
--- a/lib/PublicInbox/ViewVCS.pm
+++ b/lib/PublicInbox/ViewVCS.pm
@@ -409,8 +409,9 @@ sub show_tree_result ($$) {
my $upfx = $ctx->{-upfx} //= '../../';
if (defined $pfx) {
$pfx =~ s!/+\z!!s;
- if (my $t = $ctx->{-obj}) {
- my $t = ascii_html($t);
+ if (my $t = $ctx->{-obj}) { # $t eq "$tip:$path"
+ $t = ascii_html($t);
+ $pfx .= '/' if $pfx ne '';
$$bref .= <<EOM
\n\$ git ls-tree -l $t # shows similar output on the CLI
EOM
next reply other threads:[~2024-09-24 18:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-24 18:35 Eric Wong [this message]
2024-09-25 6:28 ` [PATCH] viewvcs: fix b= generation in $REPO/tree/ listing Štěpán Němec
2024-09-25 21:50 ` Eric Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://public-inbox.org/README
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240924183548.509216-1-e@80x24.org \
--to=e@80x24.org \
--cc=meta@public-inbox.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).