From 82a154cfbc4688e954971f8b3e48c616ca894d39 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Fri, 26 Jul 2019 22:26:41 +0700 Subject: [PATCH] Remove jbuild style diff comparison This old mode would compare without newline normalization. Signed-off-by: Rudi Grinberg --- CHANGES.md | 6 +++++- src/diff.ml | 12 ++---------- src/diff.mli | 1 - 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 06d5ecf28d01..f60e72f8221a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -17,7 +17,7 @@ - Enable `(explicit_js_mode)` by default. (#1941, @nojb) -- Add an option to clear the console in-between builds with +- Add an option to clear the console in-between builds with `--terminal-persistence=clear-on-rebuild` - Stop symlinking object files to main directory for stanzas defined `jbuild` @@ -43,6 +43,10 @@ - Define (paths ...) fields in (context ...) definitions in order to set or extend any PATH-like variable in the context environment. (#2426, @nojb) +- The `diff` action will always normalize newlines before diffing. Perviousy, it + would not do this normalization for rules defined in jbuild files. (#2457, + @rgrinberg) + 1.11.0 (23/07/2019) ------------------- diff --git a/src/diff.ml b/src/diff.ml index a929ad12e5ba..098205d1ad6b 100644 --- a/src/diff.ml +++ b/src/diff.ml @@ -4,15 +4,9 @@ module Mode = struct type t = | Binary | Text - | Text_jbuild - - let of_kind : Dune_lang.File_syntax.t -> t = - function - | Jbuild -> Text_jbuild - | Dune -> Text let compare_files = function - | Text_jbuild | Binary -> Io.compare_files + | Binary -> Io.compare_files | Text -> Io.compare_text_files end @@ -27,10 +21,8 @@ let decode path ~optional = let open Dune_lang.Decoder in let+ file1 = path and+ file2 = path - and+ kind = Stanza.file_kind () in - let mode = Mode.of_kind kind in - { optional ; file1; file2; mode } + { optional ; file1; file2; mode = Text } let decode_binary path = let open Dune_lang.Decoder in diff --git a/src/diff.mli b/src/diff.mli index 57ba4bce5232..6d0e4d9ba20b 100644 --- a/src/diff.mli +++ b/src/diff.mli @@ -6,7 +6,6 @@ module Mode : sig type t = | Binary (** no diffing, just raw comparison *) | Text (** diffing after newline normalization *) - | Text_jbuild (** diffing but no newline normalization *) end type 'path t =