@matheusbsbs / matheus-bagliano / commits / 4280cde95f
Fork 0

gitweb: Show "no difference" message for empty diff

Currently, gitweb shows only header and footer, if no differences are found. This patch adds a "No differences found" message for the html output. Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at> Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>

Martin Koegler committed Apr 22, 2007 at 22:49 UTC 4280cde95fa4e3fb012eb6d0c239a7777baaf60c
2 files changed +7
gitweb/gitweb.css
+4
@@ -387,6 +387,10 @@ div.diff.incomplete {
387 color: #cccccc;
388 }
389
390 +div.diff.nodifferences {
391 + font-weight: bold;
392 + color: #600000;
393 +}
394
395 div.index_include {
396 border: solid #d9d8d1;
gitweb/gitweb.perl
+3
@@ -2398,6 +2398,7 @@ sub git_patchset_body {
2398 my ($fd, $difftree, $hash, $hash_parent) = @_;
2399
2400 my $patch_idx = 0;
2401 + my $patch_number = 0;
2402 my $patch_line;
2403 my $diffinfo;
2404 my (%from, %to);
@@ -2419,6 +2420,7 @@ sub git_patchset_body {
2420 # git diff header
2421 #assert($patch_line =~ m/^diff /) if DEBUG;
2422 #assert($patch_line !~ m!$/$!) if DEBUG; # is chomp-ed
2423 + $patch_number++;
2424 push @diff_header, $patch_line;
2425
2426 # extended diff header
@@ -2581,6 +2583,7 @@ sub git_patchset_body {
2583 } continue {
2584 print "</div>\n"; # class="patch"
2585 }
2586 + print "<div class=\"diff nodifferences\">No differences found</div>\n" if (!$patch_number);
2587
2588 print "</div>\n"; # class="patchset"
2589 }