Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove jbuild style diff comparison #2457

Merged
merged 1 commit into from
Jul 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,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 @@ -46,6 +46,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