From c71c56565939b02fce48f0d6ca9cbf46a44bcc6f Mon Sep 17 00:00:00 2001 From: Jesse Haber-Kucharsky Date: Thu, 18 Feb 2021 17:41:05 -0500 Subject: [PATCH] Make patdiff show refined diffs Refined diffs are the whole point of patdiff! Signed-off-by: Jesse Haber-Kucharsky --- CHANGES.md | 2 ++ src/dune_engine/print_diff.ml | 14 +++++--------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 3145e6bd2d2d..38461699f396 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,8 @@ Unreleased ---------- +- Make `patdiff` show refined diffs (#4257, fixes #4254, @hakuch) + - Allow `(package pkg)` in dependencies even if `pkg` is an installed package (#4170, @bobot) diff --git a/src/dune_engine/print_diff.ml b/src/dune_engine/print_diff.ml index d6c5c69b9b2e..18947f2a5d0e 100644 --- a/src/dune_engine/print_diff.ml +++ b/src/dune_engine/print_diff.ml @@ -89,16 +89,12 @@ let print ?(skip_trailing_cr = Sys.win32) path1 path2 = | Some prog -> let* () = Process.run ~dir ~env:Env.initial Strict prog - [ "-keep-whitespace" - ; "-location-style" - ; "omake" - ; ( if Lazy.force Ansi_color.stderr_supports_color then - "-unrefined" + ( [ "-keep-whitespace"; "-location-style"; "omake" ] + @ ( if Lazy.force Ansi_color.stderr_supports_color then + [] else - "-ascii" ) - ; file1 - ; file2 - ] + [ "-ascii" ] ) + @ [ file1; file2 ] ) in (* Use "diff" if "patdiff" reported no differences *) normal_diff () )