]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: Empty patch for merge means trivial merge, not no differences
authorJakub Narebski <redacted>
Wed, 16 May 2007 22:05:55 +0000 (00:05 +0200)
committerLady <redacted>
Mon, 6 Apr 2026 04:07:11 +0000 (00:07 -0400)
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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl

index 52e346152210be1d35a93cef8955d19e9cea99eb5c60a03c3d615936f90b1c55..6934d1b1042a7dde26917bf11287428605674177b9d1ea4558b5877ce41bd27c 100755 (executable)
@@ -2878,7 +2878,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"
 }
This page took 0.216987 seconds and 4 git commands to generate.