Announcing Hex Diff

Hey everyone! It’s my enormous pleasure to present Hex Diff, an official service for generating web-based diffs between package versions on Hex. You can find it at

Read more about it and why it’s a great tool for the community on the announcement blog post!


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


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.


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


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


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

1 Like

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 to the latest diff? :slight_smile:

1 Like

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

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 :slight_smile:


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.


Using git diff was a pragmatic choice with libraries support (we use 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)


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).

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


You can see the exact command run here

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


Yeah, I have seen that. PR is ready.


I have spotted that Elixir already provides functionality that I wanted to implement - List.myers_difference/2, 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.

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 (, .DS_Store file (mac related?) is included on the change. But when i try to see github repo for 3.3.2 ( i could not find .DS_Store file.

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.