Skip to content

Commit

Permalink
Make patdiff show refined diffs
Browse files Browse the repository at this point in the history
Refined diffs are the whole point of patdiff!

Signed-off-by: Jesse Haber-Kucharsky <jesse@haber-kucharsky.com>
  • Loading branch information
hakuch committed Feb 18, 2021
1 parent 0831f39 commit c71c565
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
14 changes: 5 additions & 9 deletions src/dune_engine/print_diff.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 () )

0 comments on commit c71c565

Please sign in to comment.