git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 7/6] gitweb: Empty patch for merge means trivial merge, not no differences

From
Jakub Narebski <jnareb@gmail.com>
Date
May 16, 2007, 22:05 UTC
Message-ID
<11793531552023-git-send-email-jnareb@gmail.com>
In-Reply-To
<11784930091585-git-send-email-jnareb@gmail.com>

Earlier commit 4280cde95fa4e3fb012eb6d0c239a7777baaf60c made gitweb show "No differences found" message for empty diff, for the HTML output. But for merge commits, either -c format we use or --cc format, empty diff doesn't mean no differences, but trivial merge.

Show "Trivial merge" message instead of "No differences found" for merges.

While at it reword conditional in the code for easier reading.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
 gitweb/gitweb.perl |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 549e027..8c688be 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -2877,7 +2877,14 @@ sub git_patchset_body {
 	} continue {
 		print "</div>\n"; # class="patch"
 	}
-	print "<div class=\"diff nodifferences\">No differences found</div>\n" if (!$patch_number);
+
+	if ($patch_number == 0) {
+		if (@hash_parents > 1) {
+			print "<div class=\"diff nodifferences\">Trivial merge</div>\n";
+		} else {
+			print "<div class=\"diff nodifferences\">No differences found</div>\n";
+		}
+	}
 
 	print "</div>\n"; # class="patchset"
 }
-- 
1.5.1.4
Previous: Jakub NarebskiNext: Junio C Hamano
Message 11 of 12 in “gitweb: Add combined diff support”
  1. 0/6 gitweb: Add combined diff supportJakub Narebski, May 6, 2007
  2. 1/6 gitweb: Add parsing of raw combined diff format to parse_difftree_raw_lineJakub Narebski, May 6, 2007
  3. 2/6 gitweb: Add combined diff support to git_difftree_bodyJakub Narebski, May 6, 2007
  4. 3/6 gitweb: Add combined diff support to git_patchset_bodyJakub Narebski, May 6, 2007
  5. 4/6 gitweb: Make it possible to use pre-parsed info in git_difftree_bodyJakub Narebski, May 6, 2007
  6. 5/6 gitweb: Show combined diff for merge commits in 'commitdiff' viewJakub Narebski, May 6, 2007
  7. 6/6 gitweb: Show combined diff for merge commits in 'commit' viewJakub Narebski, May 6, 2007
  8. 7/6 todo: Remove "Gitweb diff on merge commits" entryJakub Narebski, May 6, 2007
  9. Junio C HamanoMay 8, 2007
  10. Jakub NarebskiMay 8, 2007
  11. 7/6 gitweb: Empty patch for merge means trivial merge, not no differencesJakub Narebski, May 16, 2007
  12. Junio C HamanoMay 16, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.