ssfrr/DeepDiffs.jl

Flag to limit number of unchanged lines to show when displaying deep multiline diff

Opened this issue · 2 comments

When a diff is shown e.g on github, is is common to only show a certain amount of context around the changed lines.
Showing ... and for skipped characters/lines
So as to limit the amount of unchanged content to display,

Since I generally not interested in knowing about the 10,000 lines that did not change.
Only in the 20 that did.

I am thinking something like deepdiff(orig, modified; displayafter=5, displaybefore=5)
These arguments could default to typemax(Int) to maintain current behavior.

What to do with single line diffs is another question.
I think it might be reasonable to do limits oncharacters before and after in he same way.

ssfrr commented

I think this is a good idea (especially line-wise, I'm a little less convinced about limiting context within a single line).

I'd even be a fan of defaulting the context to something sane like 5-10 lines before and after. One issue is that I think you'd need to add a little bit of info for what line the context starts on, or at least something like ⋮ (182 lines skipped).

I don't think I'll have time to do this on a short timeframe, but I'd definitely accept a PR.

Do not expect a PR any time soon. (Thesis is really due)
But if it bugs me enough I might make one sooner or later