Skip to content

Use Hex diff library for diff and patch#4

Open
dgoldie wants to merge 2 commits intoandyl:masterfrom
dgoldie:elixir_native_diff_patch
Open

Use Hex diff library for diff and patch#4
dgoldie wants to merge 2 commits intoandyl:masterfrom
dgoldie:elixir_native_diff_patch

Conversation

@dgoldie
Copy link
Copy Markdown

@dgoldie dgoldie commented Jul 2, 2021

No description provided.

@andyl
Copy link
Copy Markdown
Owner

andyl commented Jul 2, 2021

Doug, thanks for this!

Please submit a diff solution that will convert to/from JSON. The expression Diff.diff("asdf", "assdf") |> Jason.encode!() raises an error.

Also: if you can come up with a solution that does not require use of 3rd party dependency, that would be optimal. But in the near term, I would for sure prefer a dependency vs shelling out to the linux utils.

FYI I added a bit more context to Issue #2.

Thanks again for this PR!

@andyl
Copy link
Copy Markdown
Owner

andyl commented Jul 2, 2021

Just saw this on Elixir Forum - maybe a solution?

https://elixirforum.com/t/serialize-and-unserialize-structs-tuples-keyword-lists-atoms/40794

- using Hex diff and patch
- convert diff to map to pass through json
- 3 test cases
  - insert row
  - delete row
  - insert and delete row
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants