From: Martin Koegler Date: Mon, 23 Apr 2007 05:49:25 +0000 (-0700) Subject: gitweb: Show "no difference" message for empty diff X-Git-Tag: v1.5.2-rc0 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6b4b7cf3b7dea2f1aadf9e2bd21da75dae9bbc5b;p=git.git 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 Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano --- diff --git a/gitweb/gitweb.css b/gitweb/gitweb.css index 5e4029240..2b023bd98 100644 --- a/gitweb/gitweb.css +++ b/gitweb/gitweb.css @@ -387,6 +387,10 @@ div.diff.incomplete { color: #cccccc; } +div.diff.nodifferences { + font-weight: bold; + color: #600000; +} div.index_include { border: solid #d9d8d1; diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index c48b35aa3..cbd8d03e6 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -2398,6 +2398,7 @@ sub git_patchset_body { my ($fd, $difftree, $hash, $hash_parent) = @_; my $patch_idx = 0; + my $patch_number = 0; my $patch_line; my $diffinfo; my (%from, %to); @@ -2419,6 +2420,7 @@ sub git_patchset_body { # git diff header #assert($patch_line =~ m/^diff /) if DEBUG; #assert($patch_line !~ m!$/$!) if DEBUG; # is chomp-ed + $patch_number++; push @diff_header, $patch_line; # extended diff header @@ -2581,6 +2583,7 @@ sub git_patchset_body { } continue { print "\n"; # class="patch" } + print "
No differences found
\n" if (!$patch_number); print "\n"; # class="patchset" }