# Announcing Hex Diff

**URL:** <https://forum.elixirforum.com/t/announcing-hex-diff/28421>\
**Category:** Elixir News\
**Tags:** elixir-announcement\
**Created:** [January 20, 2020, 8:11pm UTC](https://forum.elixirforum.com/t/announcing-hex-diff/28421 "2020-01-20T20:11:59Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![jola](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/jola/32/18010_2.png) [@jola](https://forum.elixirforum.com/u/jola)\
**Post date:** [January 20, 2020, 8:11pm UTC](https://forum.elixirforum.com/t/announcing-hex-diff/28421/1 "2020-01-20T20:11:59Z")

</div>

Hey everyone! It’s my enormous pleasure to present Hex Diff, an official hex.pm service for generating web-based diffs between package versions on Hex. You can find it at [https://diff.hex.pm](https://diff.hex.pm).

Read more about it and why it’s a great tool for the community on the [announcement blog post](https://hex.pm/blog/announcing-hex-diff)!

---

<div class="post-metadata">

**Author:** ![hudson2010](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hudson2010/32/20463_2.png) [@hudson2010](https://forum.elixirforum.com/u/hudson2010)\
**Post date:** [January 20, 2020, 8:28pm UTC](https://forum.elixirforum.com/t/announcing-hex-diff/28421/3 "2020-01-20T20:28:07Z")

</div>

Thanks, for the great work done , I have tested on cowboy lib and it highlighted the major difference between version thanks great work !!!

---

<div class="post-metadata">

**Author:** ![sergio](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sergio/32/26966_2.png) [@sergio](https://forum.elixirforum.com/u/sergio)\
**Post date:** [January 20, 2020, 8:39pm UTC](https://forum.elixirforum.com/t/announcing-hex-diff/28421/4 "2020-01-20T20:39:34Z")

</div>

The amount of just cool stuff the Elixir community builds is astounding. Thanks for yet another very productive feature! This will make upgrading our older dependencies a little less scary.

---

<div class="post-metadata">

**Author:** ![axelson](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/axelson/32/26351_2.png) [@axelson](https://forum.elixirforum.com/u/axelson)\
**Post date:** [January 20, 2020, 9:21pm UTC](https://forum.elixirforum.com/t/announcing-hex-diff/28421/5 "2020-01-20T21:21:54Z")

</div>

Wow, that’s great! Thanks so much for spearheading this @jola! This is a great service to have officially running ❤

---

<div class="post-metadata">

**Author:** ![sb8244](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sb8244/32/18642_2.png) [@sb8244](https://forum.elixirforum.com/u/sb8244)\
**Post date:** [January 21, 2020, 12:30am UTC](https://forum.elixirforum.com/t/announcing-hex-diff/28421/6 "2020-01-21T00:30:36Z")

</div>

This is such a convenient and useful tool. Great work!

---

<div class="post-metadata">

**Author:** ![pmangalakader](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/p/bc79bd/32.png) [@pmangalakader](https://forum.elixirforum.com/u/pmangalakader)\
**Post date:** [January 21, 2020, 7:16am UTC](https://forum.elixirforum.com/t/announcing-hex-diff/28421/7 "2020-01-21T07:16:13Z")

</div>

Wonderful work!!! Congratulations to all people who had worked on this tool! 🥳

---

<div class="post-metadata">

**Author:** ![zimt28](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/zimt28/32/9933_2.png) [@zimt28](https://forum.elixirforum.com/u/zimt28)\
**Post date:** [January 21, 2020, 8:03am UTC](https://forum.elixirforum.com/t/announcing-hex-diff/28421/8 "2020-01-21T08:03:47Z")

</div>

Very useful tool, thanks! Would it be possible to add some information like a total `X files changed, Y lines added, Z lines removed` and then `+X lines, -Y lines` per file?

And what about a link on `hex.pm/package` to the latest diff? 🙂

---

<div class="post-metadata">

**Author:** ![jola](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/jola/32/18010_2.png) [@jola](https://forum.elixirforum.com/u/jola)\
**Post date:** [January 21, 2020, 8:08am UTC](https://forum.elixirforum.com/t/announcing-hex-diff/28421/9 "2020-01-21T08:08:17Z")

</div>

That’s something we can look into, don’t hesitate to make an issue on the diff repo with your ideas and examples of what it would look like!

There are links to the diffs, but they might be a bit tricky to see

 ![image](https://forum.elixirforum.com/uploads/default/original/3X/8/4/84cf28a1e0af31884f9c5d4306e6e620a065f485.png)

If you have ideas for how to improve the UI and make the diffs easier to see, please make an issue on the hexpm repo 🙂

---

<div class="post-metadata">

**Author:** ![hauleth](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hauleth/32/18942_2.png) [@hauleth](https://forum.elixirforum.com/u/hauleth)\
**Post date:** [January 21, 2020, 9:51am UTC](https://forum.elixirforum.com/t/announcing-hex-diff/28421/10 "2020-01-21T09:51:41Z")

</div>

I have checked it out, and for now one thing brought my attention - why fire `git diff` to compare two projects? Now I am thinking about writing diff algorithm in Elixir or to bring it via NIF to `xdiff`.

---

<div class="post-metadata">

**Author:** ![wojtekmach](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/wojtekmach/32/999_2.png) [@wojtekmach](https://forum.elixirforum.com/u/wojtekmach)\
**Post date:** [January 21, 2020, 10:07am UTC](https://forum.elixirforum.com/t/announcing-hex-diff/28421/11 "2020-01-21T10:07:51Z")

</div>

> [@hauleth](#):
>
> why fire `git diff` to compare two projects? Now I am thinking about writing diff algorithm in Elixir or to bring it via NIF to `xdiff` .

Using `git diff` was a pragmatic choice with libraries support (we use [git\_diff | Hex](https://hex.pm/packages/git_diff) to parse hunks to provide better user experience).

I think a pure Elixir solution would be interesting and in fact that could be a great default for another tool: `mix hex.package diff` (we couldn’t use a NIF there)

---

<div class="post-metadata">

**Author:** ![hauleth](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hauleth/32/18942_2.png) [@hauleth](https://forum.elixirforum.com/u/hauleth)\
**Post date:** [January 21, 2020, 10:14am UTC](https://forum.elixirforum.com/t/announcing-hex-diff/28421/12 "2020-01-21T10:14:58Z")

</div>

> [@wojtekmach](#):
>
> Using `git diff` was a pragmatic choice with libraries support (we use [git\_diff | Hex](https://hex.pm/packages/git_diff) to parse hunks to provide better user experience).

`xdiff` is library used by Git, so there should be no difference. By the way, do you use regular algorithm or patience? Patience one should give slightly better results while being slightly more computationally expensive (but caching should made it neglible difference).

> [@wojtekmach](#):
>
> I think a pure Elixir solution would be interesting and in fact that could be a great default for another tool: `mix hex.package diff` (we couldn’t use a NIF there)

I will try to write something like that in some spare time.

---

<div class="post-metadata">

**Author:** ![jola](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/jola/32/18010_2.png) [@jola](https://forum.elixirforum.com/u/jola)\
**Post date:** [January 21, 2020, 10:24am UTC](https://forum.elixirforum.com/t/announcing-hex-diff/28421/13 "2020-01-21T10:24:41Z")

</div>

You can see the exact command run here [diff/lib/diff/hex/hex.ex at main · hexpm/diff · GitHub](https://github.com/hexpm/diff/blob/master/lib/diff/hex/hex.ex#L94-L102)

A solution that doesn’t require shelling out to `git` is absolutely welcome!

---

<div class="post-metadata">

**Author:** ![hauleth](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hauleth/32/18942_2.png) [@hauleth](https://forum.elixirforum.com/u/hauleth)\
**Post date:** [January 21, 2020, 10:32am UTC](https://forum.elixirforum.com/t/announcing-hex-diff/28421/14 "2020-01-21T10:32:23Z")

</div>

> [@jola](#):
>
> You can see the exact command run here [diff/lib/diff/hex/hex.ex at main · hexpm/diff · GitHub](https://github.com/hexpm/diff/blob/master/lib/diff/hex/hex.ex#L94-L102)

Yeah, I have seen that. [PR is ready](https://github.com/hexpm/diff/pull/33).

---

<div class="post-metadata">

**Author:** ![hauleth](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hauleth/32/18942_2.png) [@hauleth](https://forum.elixirforum.com/u/hauleth)\
**Post date:** [January 24, 2020, 2:03pm UTC](https://forum.elixirforum.com/t/announcing-hex-diff/28421/15 "2020-01-24T14:03:00Z")

</div>

I have spotted that Elixir already provides functionality that I wanted to implement - [`List.myers_difference/2`](https://hexdocs.pm/elixir/List.html#myers_difference/F2), however I would need to dig more if there is space for optimisations, I am still learning the Myer’s algorithm.

@jola you can see that one and see how much performance difference is there between calling external Git command vs using above function on in-memory data. If there is noticeable difference that cannot be solved by caching then I can try to implement NIF for Git’s xdiff library.

---

<div class="post-metadata">

**Author:** ![csadewa](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/csadewa/32/24535_2.png) [@csadewa](https://forum.elixirforum.com/u/csadewa)\
**Post date:** [February 7, 2020, 7:16am UTC](https://forum.elixirforum.com/t/announcing-hex-diff/28421/16 "2020-02-07T07:16:53Z")

</div>

Just read it today, hex diff seems nice!

however i am confused on `.DS_Store`. while trying hex diff on Ecto 3.3.1 to 3.3.2 ([ecto 3.3.1..3.3.2 | hexdiff](https://diff.hex.pm/diff/ecto/3.3.1..3.3.2)), `.DS_Store` file (mac related?) is included on the change. But when i try to see github repo for 3.3.2 ([ecto/lib/mix/tasks at v3.3.2 · elixir-ecto/ecto · GitHub](https://github.com/elixir-ecto/ecto/tree/v3.3.2/lib/mix/tasks)) i could not find `.DS_Store` file.

 ![image](https://forum.elixirforum.com/uploads/default/original/3X/2/c/2cd0b56867ccacbbb3b8db2259a426bb6ecaa6b2.png)

---

<div class="post-metadata">

**Author:** ![LostKobrakai](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/lostkobrakai/32/3072_2.png) [@LostKobrakai](https://forum.elixirforum.com/u/LostKobrakai)\
**Post date:** [February 7, 2020, 7:34am UTC](https://forum.elixirforum.com/t/announcing-hex-diff/28421/17 "2020-02-07T07:34:22Z")

</div>

Github and hex are completely unrelated. Files are directly uploaded from the maintainers computer. They might just have a .gitignore setup for .DS\_Store files.
