diff options
-rw-r--r-- | gitweb/gitweb.css | 5 | ||||
-rwxr-xr-x | gitweb/gitweb.perl | 21 |
2 files changed, 26 insertions, 0 deletions
diff --git a/gitweb/gitweb.css b/gitweb/gitweb.css index 9f0822fab..7908fe3b5 100644 --- a/gitweb/gitweb.css +++ b/gitweb/gitweb.css @@ -181,10 +181,15 @@ table.diff_tree { font-family: monospace; } +table.combined.diff_tree th { + text-align: center; +} + table.combined.diff_tree td { padding-right: 24px; } +table.combined.diff_tree th.link, table.combined.diff_tree td.link { padding: 0px 2px; } diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index e92596c29..e2d52222b 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -2401,6 +2401,26 @@ sub git_difftree_body { print "<table class=\"" . (@parents > 1 ? "combined " : "") . "diff_tree\">\n"; + + # header only for combined diff in 'commitdiff' view + my $has_header = @parents > 1 && $action eq 'commitdiff'; + if ($has_header) { + # table header + print "<thead><tr>\n" . + "<th></th><th></th>\n"; # filename, patchN link + for (my $i = 0; $i < @parents; $i++) { + my $par = $parents[$i]; + print "<th>" . + $cgi->a({-href => href(action=>"commitdiff", + hash=>$hash, hash_parent=>$par), + -title => 'commitdiff to parent number ' . + ($i+1) . ': ' . substr($par,0,7)}, + $i+1) . + " </th>\n"; + } + print "</tr></thead>\n<tbody>\n"; + } + my $alternate = 1; my $patchno = 0; foreach my $line (@{$difftree}) { @@ -2673,6 +2693,7 @@ sub git_difftree_body { } # we should not encounter Unmerged (U) or Unknown (X) status print "</tr>\n"; } + print "</tbody>" if $has_header; print "</table>\n"; } |