All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/7] gitweb: show "no difference" message for empty diff
@ 2007-04-15 20:46 ` Martin Koegler
  2007-04-18 13:52   ` Jakub Narebski
  0 siblings, 1 reply; 21+ messages in thread
From: Martin Koegler @ 2007-04-15 20:46 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: git, Martin Koegler

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>
---
$patch_idx does not work, so I need a new variable.

The css style for the no difference message is useable. If somebody
does not like, feel free to send a patch with a better layout.

 gitweb/gitweb.css  |    7 +++++++
 gitweb/gitweb.perl |    3 +++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/gitweb/gitweb.css b/gitweb/gitweb.css
index 5e40292..fb58bec 100644
--- a/gitweb/gitweb.css
+++ b/gitweb/gitweb.css
@@ -387,6 +387,13 @@ div.diff.incomplete {
 	color: #cccccc;
 }
 
+div.diff.nodifferences {
+	font-weight: bold;
+	background-color: #edece6;
+
+	padding: 4px;
+	border: 1px solid #d9d8d1;
+}
 
 div.index_include {
 	border: solid #d9d8d1;
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index c48b35a..cbd8d03 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 "</div>\n"; # class="patch"
 	}
+	print "<div class=\"diff nodifferences\">No differences found</div>\n" if (!$patch_number);
 
 	print "</div>\n"; # class="patchset"
 }
-- 
1.5.1.1.85.gf1888

^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2007-05-19  8:27 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-15 20:46 [PATCH 1/7] gitweb: show "no difference" message for empty diff Martin Koegler
2007-04-15 20:46 ` Martin Koegler
2007-04-18 13:52   ` Jakub Narebski
2007-04-15 20:46 ` [PATCH 2/7] gitweb: Support comparing blobs with different names Martin Koegler
2007-04-15 20:46   ` Martin Koegler
2007-04-20 10:34     ` Jakub Narebski
2007-04-20 11:24       ` Junio C Hamano
2007-04-20 20:49         ` Jakub Narebski
2007-04-21 12:23           ` [PATCH 0/4] git-diff: use mode for tree:name syntax (was: Re: [PATCH 2/7] gitweb: Support comparing blobs with different names) Martin Koegler
2007-04-16 20:18   ` [PATCH 2/7] gitweb: Support comparing blobs with different names Martin Koegler
2007-04-29 21:35     ` Jakub Narebski
2007-04-30  5:27       ` Martin Koegler
2007-04-15 20:46 ` [PATCH 3/7] gitweb: support filename prefix in git_patchset_body/git_difftree_body Martin Koegler
2007-04-15 20:46   ` Martin Koegler
2007-04-27 10:55     ` Jakub Narebski
2007-04-28  8:22       ` Martin Koegler
2007-04-15 20:46 ` [PATCH 4/7] gitweb: Add treediff view Martin Koegler
2007-04-15 20:46   ` Martin Koegler
2007-04-16 20:20   ` Martin Koegler
2007-04-15 20:46 ` [PATCH 5/7] gitweb: Prototyp for selecting diffs in JavaScript Martin Koegler
2007-04-15 20:46   ` Martin Koegler
2007-05-18  8:49   ` Petr Baudis
2007-05-19  7:57     ` Martin Koegler
2007-05-19  8:27       ` Petr Baudis
2007-04-15 20:46 ` [PATCH 6/7] gitweb: pass root directory as empty file parameter Martin Koegler
2007-04-15 20:46   ` Martin Koegler
2007-04-15 20:46 ` [PATCH 7/7] gitweb: Adapt gitweb.js to new git_treeview calling convention Martin Koegler
2007-04-15 20:46   ` Martin Koegler

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.