+# returns seconds offset from git TZ offset
+sub tz_adj ($) {
+ my ($tz) = @_; # e.g "-0700"
+ $tz = int($tz);
+ my $mm = $tz < 0 ? -$tz : $tz;
+ $mm = int($mm / 100) * 60 + ($mm % 100);
+ $mm = $tz < 0 ? -$mm : $mm;
+ ($mm * 60);
+}
+
+sub show_tag_result { # git->cat_async callback
+ my ($bref, $oid, $type, $size, $ctx) = @_;
+ utf8::decode($$bref);
+ my $l = PublicInbox::Linkify->new;
+ $$bref = $l->to_html($$bref);
+ $$bref =~ s!^object ([a-f0-9]+)!object <a
+href=../../$1/s/>$1</a>!;
+
+ $$bref =~ s/^(tagger .*> )([0-9]+) ([\-+]?[0-9]+)/$1.strftime(
+ '%Y-%m-%d %H:%M:%S', gmtime($2 + tz_adj($3)))." $3"/sme;
+ # TODO: download link
+ html_page($ctx, 200, '<pre>', $$bref, '</pre>', dbg_log($ctx));
+}
+
+sub show_tag ($$) {
+ my ($ctx, $res) = @_;
+ my ($git, $oid) = @$res;
+ $ctx->{git} = $git;
+ if ($ctx->{env}->{'pi-httpd.async'}) {
+ ibx_async_cat($ctx, $oid, \&show_tag_result, $ctx);
+ } else { # synchronous (generic PSGI)
+ $git->cat_async($oid, \&show_tag_result, $ctx);
+ $git->cat_async_wait;
+ }
+}
+