+sub show_other ($$$$) {
+ my ($ctx, $res, $logref, $fn) = @_;
+ my ($git, $oid, $type, $size) = @$res;
+ if ($size > $MAX_SIZE) {
+ $$logref = "$oid is too big to show\n" . $$logref;
+ return html_page($ctx, 200, $logref);
+ }
+ my $cmd = ['git', "--git-dir=$git->{git_dir}",
+ qw(show --encoding=UTF-8 --no-color --no-abbrev), $oid ];
+ my $qsp = PublicInbox::Qspawn->new($cmd);
+ my $env = $ctx->{env};
+ $ctx->{-qsp} = $qsp;
+ $ctx->{-logref} = $logref;
+ $qsp->psgi_qx($env, undef, \&show_other_result, $ctx);
+}
+
+# user_cb for SolverGit, called as: user_cb->($result_or_error, $uarg)
+sub solve_result {
+ my ($res, $ctx) = @_;
+ my ($log, $hints, $fn) = delete @$ctx{qw(log hints fn)};
+
+ unless (seek($log, 0, 0)) {
+ $ctx->{env}->{'psgi.errors'}->print("seek(log): $!\n");
+ return html_page($ctx, 500, \'seek error');
+ }