Skip to content

Commit

Permalink
Remove jbuild style diff comparison
Browse files Browse the repository at this point in the history
This old mode would compare without newline normalization.

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
  • Loading branch information
rgrinberg committed Jul 26, 2019
1 parent f03f703 commit 82a154c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
6 changes: 5 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -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)
-------------------

Expand Down
12 changes: 2 additions & 10 deletions src/diff.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/diff.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit 82a154c

Please sign in to comment.