diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 68629f66c9..f69ed08310 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -4890,7 +4890,7 @@ sub print_sidebyside_diff_chunk { # empty contents block on start rem/add block, or end of chunk if (@ctx && (!$class || $class eq 'rem' || $class eq 'add')) { print join '', - '
', + '
', '
', @ctx, '
', @@ -4902,15 +4902,34 @@ sub print_sidebyside_diff_chunk { } # empty add/rem block on start context block, or end of chunk if ((@rem || @add) && (!$class || $class eq 'ctx')) { - print join '', - '
', - '
', - @rem, - '
', - '
', - @add, - '
', - '
'; + if (!@add) { + # pure removal + print join '', + '
', + '
', + @rem, + '
', + '
'; + } elsif (!@rem) { + # pure addition + print join '', + '
', + '
', + @add, + '
', + '
'; + } else { + # assume that it is change + print join '', + '
', + '
', + @rem, + '
', + '
', + @add, + '
', + '
'; + } @rem = @add = (); } diff --git a/gitweb/static/gitweb.css b/gitweb/static/gitweb.css index 21842a66ac..c7827e8f1d 100644 --- a/gitweb/static/gitweb.css +++ b/gitweb/static/gitweb.css @@ -491,6 +491,19 @@ div.chunk_block div.new { width: 50%; } +div.chunk_block.rem div.old div.diff.rem { + background-color: #fff5f5; +} +div.chunk_block.add div.new div.diff.add { + background-color: #f8fff8; +} +div.chunk_block.chg div div.diff { + background-color: #fffff0; +} +div.chunk_block.ctx div div.diff.ctx { + color: #404040; +} + div.index_include { border: solid #d9d8d1;