From f4da9ad6667697b512f8fb673b9cc3f927635245 Mon Sep 17 00:00:00 2001 From: Hannes Mehnert Date: Fri, 5 Aug 2022 11:16:21 +0200 Subject: [PATCH] In Opamdiff.compare, do not figure out unchanged packages. In the View.compare_builds (/compare/..), do not display "XX opam packages unchanged". The reasoning is that the diff view concerns: (a) opam packages (b) environment variables (c) system packages And we're only interested in what changed in each category. The list of unchanged opam packages is not really of interest, but adds quite some noise to the page. --- lib/views.ml | 9 +-------- opamdiff/opamdiff.ml | 8 ++++---- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/lib/views.ml b/lib/views.ml index 9e5ae72..104fac4 100644 --- a/lib/views.ml +++ b/lib/views.ml @@ -848,7 +848,7 @@ let compare_builds ~(build_right : Builder_db.Build.t) ~env_diff:(added_env, removed_env, changed_env) ~pkg_diff:(added_pkgs, removed_pkgs, changed_pkgs) - ~opam_diff:(same, opam_diff, version_diff, left, right) + ~opam_diff:(opam_diff, version_diff, left, right) = layout ~nav:(`Comparison ((job_left, build_left), (job_right, build_right))) @@ -902,10 +902,6 @@ let compare_builds [txtf "%d opam packages with changes in their opam file" (List.length opam_diff)] ]; - H.li [ - H.a ~a:H.[a_href "#opam-packages-unchanged"] - [txtf "%d opam packages unchanged" (OpamPackage.Set.cardinal same)] - ]; H.li [ H.a ~a:H.[a_href "#env-added"] [ txtf "%d environment variables added" (List.length added_env)] @@ -943,9 +939,6 @@ let compare_builds H.h3 ~a:H.[a_id "opam-packages-opam-diff"] [H.txt "Opam packages with changes in their opam file"]] @ opam_diffs opam_diff @ [ - H.h3 ~a:H.[a_id "opam-packages-unchanged"] - [H.txt "Unchanged opam packages"]; - H.code (packages same); H.h3 ~a:H.[a_id "env-added"] [H.txt "Environment variables added"]; H.code (key_values added_env); H.h3 ~a:H.[a_id "env-removed"] [H.txt "Environment variables removed"]; diff --git a/opamdiff/opamdiff.ml b/opamdiff/opamdiff.ml index 430f7b3..097bc9f 100644 --- a/opamdiff/opamdiff.ml +++ b/opamdiff/opamdiff.ml @@ -102,12 +102,12 @@ let compare left right = l in let same_version = Set.inter packages_left packages_right in - let (same, opam_diff) = - Set.partition + let opam_diff = + Set.filter (fun p -> let find = OpamPackage.Name.Map.find p.name in let opam_left = find left.overlays and opam_right = find right.overlays in - OpamFile.OPAM.effectively_equal opam_left opam_right) + not (OpamFile.OPAM.effectively_equal opam_left opam_right)) same_version and version_diff = List.filter_map (fun p1 -> @@ -126,4 +126,4 @@ let compare left right = and right_pkgs = diff packages_right packages_left in let opam_diff = detailed_opam_diffs left right opam_diff in - (same, opam_diff, version_diff, left_pkgs, right_pkgs) + (opam_diff, version_diff, left_pkgs, right_pkgs)