]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: Show "no difference" message for empty diff
authorMartin Koegler <redacted>
Mon, 23 Apr 2007 05:49:25 +0000 (22:49 -0700)
committerLady <redacted>
Mon, 6 Apr 2026 04:07:11 +0000 (00:07 -0400)
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 <redacted>
Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.css
gitweb.perl

index 5ff0317fad223f4c467e45435ed6b4bfb1b7f8eb7aeb63938e5006c8427f9a1a..ff026dbe4a6d2687ddecdbd6bdc38356e6e848bc6d83af1f2dcbf4e11f7e59fe 100644 (file)
@@ -387,6 +387,10 @@ div.diff.incomplete {
        color: #cccccc;
 }
 
+div.diff.nodifferences {
+       font-weight: bold;
+       color: #600000;
+}
 
 div.index_include {
        border: solid #d9d8d1;
index 47dc9e13e55b6b03ee3c3e18df1747d14c25fbf44ee94e8cc22c16e5cd23a79a..b40fd35dc10b85f39687b1ae960d28da320f860fd1754ea5882de9303a621cfd 100755 (executable)
@@ -2399,6 +2399,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);
@@ -2420,6 +2421,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
@@ -2582,6 +2584,7 @@ sub git_patchset_body {
        } continue {
                print "</div>\n"; # class="patch"
        }
+       print "<div class=\"diff nodifferences\">No differences found</div>\n" if (!$patch_number);
 
        print "</div>\n"; # class="patchset"
 }
This page took 0.251892 seconds and 4 git commands to generate.