commit $ctx->{cmt_H}$x
- tree $ctx->{cmt_T}
+ commit $H$x
+ tree $T
author $au
committer $co
$s
EOM
- $x = delete $ctx->{cmt_b};
- $ctx->zmore("\n", $ctx->{-linkify}->to_html($x)) if length($x);
- undef $x;
+ $ctx->zmore("\n", $ctx->{-linkify}->to_html($bdy)) if length($bdy);
+ $bdy = '';
open my $fh, '<:utf8', "$ctx->{-tmp}/p" or
die "open $ctx->{-tmp}/p: $!";
if (-s $fh > $MAX_SIZE) {
$ctx->zmore("---\n patch is too large to show\n");
} else { # prepare flush_diff:
- $ctx->{obuf} = \$x;
+ read($fh, $x, -s _);
+ $ctx->{obuf} = \$bdy;
$ctx->{-apfx} = $ctx->{-spfx} = $upfx;
- read($fh, my $bdy, -s _);
- $bdy =~ s/\r?\n/\n/gs;
- $ctx->{-anchors} = {} if $bdy =~ /^diff --git /sm;
- flush_diff($ctx, \$bdy); # undefs $bdy
- $ctx->zmore($x);
- undef $x;
+ $x =~ s/\r?\n/\n/gs;
+ $ctx->{-anchors} = {} if $x =~ /^diff --git /sm;
+ flush_diff($ctx, \$x); # undefs $x
+ $ctx->zmore($bdy);
+ undef $bdy;
# TODO: should there be another textarea which attempts to
# search for the exact email which was applied to make this
# commit?
@@ -241,7 +238,24 @@ id=related>find related emails, including ancestors/descendants/conflicts
EOM
}
}
- $x = $ctx->zflush($ctx->_html_end);
+ chop($x = <glossary
+--------
+Commit objects reference one tree, and zero or more parents.
+
+Single parent commits can typically generate a patch in
+unified diff format via `git format-patch'.
+
+Multiple parents means the commit is a merge.
+
+Root commits have no ancestor. Note that it is
+possible to have multiple root commits when merging independent histories.
+
+Every commit references one top-level tree object.
+EOM
+ $x = $ctx->zflush($x, $ctx->_html_end);
my $res_hdr = delete $ctx->{-res_hdr};
push @$res_hdr, 'Content-Length', length($x);
delete($ctx->{env}->{'qspawn.wcb'})->([200, $res_hdr, [$x]]);
@@ -401,7 +415,7 @@ sub solve_result {
return stream_large_blob($ctx, $res) if defined $ctx->{fn};
return html_page($ctx, 200, <Too big to show, download available
-"$oid $type $size bytes $raw_link
+blob $oid $size bytes $raw_link
EOM
}
@@ -420,7 +434,7 @@ EOM
}
$bin and return html_page($ctx, 200,
- "$oid $type $size bytes (binary)" .
+ "blob $oid $size bytes (binary)" .
" $raw_link
".dbg_log($ctx));
# TODO: detect + convert to ensure validity
@@ -436,7 +450,7 @@ EOM
$$blob = ascii_html($$blob);
}
- my $x = "$oid $type $size bytes $raw_link
" .
+ my $x = "blob $oid $size bytes $raw_link
" .
"
".
"";
$x .= sprintf("% ${pad}u\n", $_) for (1..$nl);
|