hexpm / diff

Website to display diffs between Hex package versions

Home Page:https://diff.hex.pm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The diff shows that all lines are changed

take-five opened this issue · comments

Hi,

First of all, thanks for the tool, it's fantastic!

I've stumbled upon weird behavior, when tried to check the diff for observer_cli: https://diff.hex.pm/diff/observer_cli/1.5.0..1.5.3

For some reason, it doesn't show real line numbers (show "1" for all of them) and displays all lines from the older version as removed, and all lines from the newer version as added.

image

There are two issues here:

  • observer_cli changed line endings changed from \n to \r which causes the huge number of diffs. We need to decide if we should add flags such as --ignore-space-at-eol and --ignore-space-change to git diff.

  • All the line numbers being the same seems to be caused by a regression in mononym/git_diff@c2d91c4 which I am looking into. EDIT: Fixed in in v0.6.1

/cc @joladev @wojtekmach How do you think we should handle space changes in the diffs?

Regarding line numbers - I've tested that locally with both git_diff 0.6.0 and 0.6.1 as @ericmj said it should be fixed. I'm not sure about the cause of the issue because when I run it locally I have no visual issues (for all files listed) when I visit http://localhost:4004/diff/observer_cli/1.5.0..1.5.3, but for both versions of the lib I have same line numbers issue for http://localhost:4004/diff/mysql/1.5.0..1.6.0 (for all files listed), while that's working ok here https://diff.hex.pm/diff/mysql/1.5.0..1.6.0

@ericmj I guess that without thinking about it too hard, I'd expect changes in line endings to show up, but I totally see how it's not really useful in this case.

@KamilZielinski make sure to clear the cache when you switch between lib versions, to re-render the diffs, or disable caching. I don't know if you did, but it could explain the inconsistency you saw.

@joladev It was caching indeed, thanks! It works all good now