* [PATCH 0/7] www_coderepo updates
@ 2023-01-28 11:02 7% Eric Wong
2023-01-28 11:02 7% ` [PATCH 4/7] www_coderepo: reduce utf8::decode calls Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2023-01-28 11:02 UTC (permalink / raw)
To: meta
Not aiming to achieve feature parity with cgit, but
trying to minimize 404s and provide hints/education for
CLI git usage...
And having an Atom feed for just tags (not all commits) can be
nice...
Eric Wong (7):
www_coderepo: tree: quiet and 404 on non-existent refs
www_coderepo: support /$REPO/tags.atom endpoint
www_coderepo: fix snapshot link generation
www_coderepo: reduce utf8::decode calls
repo_atom: translate: account for multiple args
www_coderepo: support $REPO/refs/{heads,tags}/ endpoints
www_coderepo: summary: fix mis-linkification of `...'
lib/PublicInbox/RepoAtom.pm | 64 +++++++++---
lib/PublicInbox/RepoTree.pm | 22 ++++-
lib/PublicInbox/WwwCoderepo.pm | 173 +++++++++++++++++++++++----------
t/solver_git.t | 15 +++
4 files changed, 209 insertions(+), 65 deletions(-)
^ permalink raw reply [relevance 7%]
* [PATCH 4/7] www_coderepo: reduce utf8::decode calls
2023-01-28 11:02 7% [PATCH 0/7] www_coderepo updates Eric Wong
@ 2023-01-28 11:02 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2023-01-28 11:02 UTC (permalink / raw)
To: meta
It's safe to call utf8::decode on data where "\0" exists.
---
lib/PublicInbox/WwwCoderepo.pm | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/lib/PublicInbox/WwwCoderepo.pm b/lib/PublicInbox/WwwCoderepo.pm
index 4d8713b4..8df6116a 100644
--- a/lib/PublicInbox/WwwCoderepo.pm
+++ b/lib/PublicInbox/WwwCoderepo.pm
@@ -124,7 +124,6 @@ EOM
$last = pop(@r) if scalar(@r) > $ctx->{wcr}->{summary_branches};
for (@r) {
my ($pfx, $oid, $ref, $s, $cd) = split(/\0/);
- utf8::decode($_) for ($ref, $s);
chomp $cd;
my $align = length($ref) < 12 ? ' ' x (12 - length($ref)) : '';
print $zfh "$pfx <a\nhref=./$oid/s/>", ascii_html($ref),
@@ -148,7 +147,6 @@ EOM
}
for (@r) {
my (undef, $oid, $ref, $s, $cd) = split(/\0/);
- utf8::decode($_) for ($ref, $s);
chomp $cd;
my $align = length($ref) < 12 ? ' ' x (12 - length($ref)) : '';
print $zfh "<a\nhref=./$oid/s/>", ascii_html($ref),
@@ -169,6 +167,7 @@ EOM
sub capture_refs ($$) { # psgi_qx callback to capture git-for-each-ref + git-log
my ($bref, $ctx) = @_;
my $qsp_err = delete $ctx->{-qsp_err};
+ utf8::decode($$bref);
$ctx->{-each_refs} = $$bref;
summary_finish($ctx) if $ctx->{-readme};
}
^ permalink raw reply related [relevance 7%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2023-01-28 11:02 7% [PATCH 0/7] www_coderepo updates Eric Wong
2023-01-28 11:02 7% ` [PATCH 4/7] www_coderepo: reduce utf8::decode calls Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
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).