diff --git a/gitweb/gitweb.css b/gitweb/gitweb.css index 9f0822fab3..7908fe3b5f 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 e92596c295..e2d52222bf 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -2401,6 +2401,26 @@ sub git_difftree_body { print " 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 "\n" . + "\n"; # filename, patchN link + for (my $i = 0; $i < @parents; $i++) { + my $par = $parents[$i]; + print "\n"; + } + print "\n\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 "\n"; } + print "" if $has_header; print "
" . + $cgi->a({-href => href(action=>"commitdiff", + hash=>$hash, hash_parent=>$par), + -title => 'commitdiff to parent number ' . + ($i+1) . ': ' . substr($par,0,7)}, + $i+1) . + " 
\n"; }