From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id A0F951F61F for ; Mon, 29 Aug 2022 09:26:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1661765208; bh=U9XmMEJqsfx8+NrsIyb9xyss2JdgFmQj3IL48XdFrss=; h=From:To:Subject:Date:In-Reply-To:References:From; b=h3GecRoAMWDkNxWsEWa/O88/ReI70+WLmydTqI1JTSZSpmiOfQ5tYW//iQpDjfzOD ffYH2IFVvSJpgo/UBFB5TrUF3/96/OcdQHp8lGmtDQq7S0TBGZd4XnO9EIrJ3R4xMz mr0MEhzCxQ4jW7+VsAIIpPt/2kIQ/IE1ObDjaaso= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 07/18] viewvcs: author date links to contemporary messages Date: Mon, 29 Aug 2022 09:26:36 +0000 Message-Id: <20220829092647.1512215-8-e@80x24.org> In-Reply-To: <20220829092647.1512215-1-e@80x24.org> References: <20220829092647.1512215-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Sometimes it can be useful to figure out what's going in on the associated inbox around the time the patch was authored. --- lib/PublicInbox/ViewVCS.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/PublicInbox/ViewVCS.pm b/lib/PublicInbox/ViewVCS.pm index 84358d0e..fd95e24e 100644 --- a/lib/PublicInbox/ViewVCS.pm +++ b/lib/PublicInbox/ViewVCS.pm @@ -148,6 +148,7 @@ sub show_commit_start { # ->psgi_qx callback sub cmt_finalize { my ($ctx) = @_; $ctx->{-linkify} //= PublicInbox::Linkify->new; + my $upfx = $ctx->{-upfx} = '../../'; # from "/$INBOX/$OID/s/" # try to keep author and committer dates lined up my ($au, $co) = delete @$ctx{qw(cmt_au cmt_co)}; my $x = length($au) - length($co); @@ -159,9 +160,15 @@ sub cmt_finalize { $au =~ s/>/>$x/; } $_ = ascii_html($_) for ($au, $co); + $au =~ s!(> +)([0-9]{4,}-\S+ \S+)! + my ($gt, $t) = ($1, $2); + $t =~ tr/ :-//d; + qq($gt$2) + !e; my $s = $ctx->{-linkify}->to_html(delete $ctx->{cmt_s}); $ctx->{-title_html} = $s; - my $upfx = $ctx->{-upfx} = '../../'; # from "/$INBOX/$OID/s/" my ($P, $p, $pt) = delete @$ctx{qw(-cmt_P -cmt_p -cmt_pt)}; $_ = qq().shift(@$p).' '.shift(@$pt) for @$P; if (@$P == 1) {