From f6244586ba4f5a5e7575e1254be8c9bbe303fce9 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 15 Feb 2017 22:35:18 +0000 Subject: repobrowse: switch to new URL format to avoid query strings Query strings make endpoint caching more difficult since they're order-independent. They are also more likely lost or truncated inadvertantly when copy+pasting, so try to avoid them for default endpoints. There's still some things which are broken and followup commits will be needed to fix them. --- lib/PublicInbox/RepoGitSummary.pm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/PublicInbox/RepoGitSummary.pm') diff --git a/lib/PublicInbox/RepoGitSummary.pm b/lib/PublicInbox/RepoGitSummary.pm index e9e1458b..0ecef981 100644 --- a/lib/PublicInbox/RepoGitSummary.pm +++ b/lib/PublicInbox/RepoGitSummary.pm @@ -58,10 +58,10 @@ sub for_each_ref { my $sref; if ($type eq 'tag') { $h = "$h"; - $sref = $ref = $rel . 'tag?h=' . $ref; + $sref = $ref = $rel . 'tag/' . $ref; } elsif ($type eq 'commit') { - $sref = $rel . 'commit?h=' . $ref; - $ref = $rel . 'log?h=' . $ref; + $sref = $rel . 'commit/' . $ref; + $ref = $rel . 'log/' . $ref; } else { # no point in wasting code to support tagged # trees/blobs... @@ -82,7 +82,7 @@ sub for_each_ref { foreach my $r (@$readme) { my $doc = $git->cat_file('HEAD:'.$r); defined $doc or next; - $fh->write('
' . readme_path_links($rel, $r) .
+		$fh->write('
' . readme_path_links($req, $rel, $r) .
 			" (HEAD)\n\n" . utf8_html($$doc) . '
'); } $fh->write(''); @@ -90,17 +90,17 @@ sub for_each_ref { } sub readme_path_links { - my ($rel, $readme) = @_; + my ($req, $rel, $readme) = @_; my @path = split(m!/+!, $readme); - my $s = "tree root/"; + my $s = "tree {-tip}\">root/"; my @t; $s .= join('/', (map { push @t, $_; my $e = PublicInbox::Hval->utf8($_, join('/', @t)); my $ep = $e->as_path; my $eh = $e->as_html; - $e = "$eh"; + $e = "{-tip}/$ep\">$eh"; # bold the last one scalar(@t) == scalar(@path) ? "$e" : $e; } @path)); -- cgit v1.2.3-24-ge0c7