Skip to content

Commit

Permalink
gitweb: Show "no difference" message for empty diff
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Martin Koegler authored and Junio C Hamano committed Apr 23, 2007
1 parent 55a9137 commit 4280cde
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gitweb/gitweb.css
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,10 @@ div.diff.incomplete {
color: #cccccc;
}

div.diff.nodifferences {
font-weight: bold;
color: #600000;
}

div.index_include {
border: solid #d9d8d1;
Expand Down
3 changes: 3 additions & 0 deletions gitweb/gitweb.perl
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
Expand Down Expand Up @@ -2581,6 +2583,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"
}
Expand Down

0 comments on commit 4280cde

Please sign in to comment.