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.
Read more about it and why it’s a great tool for the community on the announcement blog post!
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.
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?
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 git_diff | Hex 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.
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.
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.