From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 3/7] www_coderepo: fix snapshot link generation
Date: Sat, 28 Jan 2023 11:02:51 +0000 [thread overview]
Message-ID: <20230128110255.2950084-4-e@80x24.org> (raw)
In-Reply-To: <20230128110255.2950084-1-e@80x24.org>
Do not assume ".git" exists as a suffix in the repo nickname,
and filter out all trailing slashes in case it didn't get
filtered from Config.
---
lib/PublicInbox/WwwCoderepo.pm | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/PublicInbox/WwwCoderepo.pm b/lib/PublicInbox/WwwCoderepo.pm
index e3d45c56..4d8713b4 100644
--- a/lib/PublicInbox/WwwCoderepo.pm
+++ b/lib/PublicInbox/WwwCoderepo.pm
@@ -142,9 +142,9 @@ EOM
my $n;
if (@s) {
$n = $ctx->{git}->local_nick // die "BUG: $ctx->{git_dir} nick";
- $n =~ s/\.git\z/-/;
- ($n) = ($n =~ m!([^/]+)\z!);
- $n = ascii_html($n);
+ $n =~ s!\.git/*\z!!;
+ ($n) = ($n =~ m!([^/]+)/*\z!);
+ $n = ascii_html($n).'-';
}
for (@r) {
my (undef, $oid, $ref, $s, $cd) = split(/\0/);
next prev parent reply other threads:[~2023-01-28 11:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-28 11:02 [PATCH 0/7] www_coderepo updates Eric Wong
2023-01-28 11:02 ` [PATCH 1/7] www_coderepo: tree: quiet and 404 on non-existent refs Eric Wong
2023-01-28 11:02 ` [PATCH 2/7] www_coderepo: support /$REPO/tags.atom endpoint Eric Wong
2023-01-28 11:02 ` Eric Wong [this message]
2023-01-28 11:02 ` [PATCH 4/7] www_coderepo: reduce utf8::decode calls Eric Wong
2023-01-28 11:02 ` [PATCH 5/7] repo_atom: translate: account for multiple args Eric Wong
2023-01-28 11:02 ` [PATCH 6/7] www_coderepo: support $REPO/refs/{heads,tags}/ endpoints Eric Wong
2023-01-28 11:02 ` [PATCH 7/7] www_coderepo: summary: fix mis-linkification of `...' 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=20230128110255.2950084-4-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).