Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I had been using delta for around a year and liked it, but still found some of the diffs I was looking a bit hard to read. A few weeks ago after a discussion on HN I tried difftastic, and have become a fan. You might want to consider it if you go down this rabbit hole. https://difftastic.wilfred.me.uk/


Still waiting for Delta + Difftastic integration:

https://github.com/dandavison/delta/issues/535


Be careful with difftastic, because it has at least one severe bug involving python that has been present for a long time: https://github.com/Wilfred/difftastic/issues/587


Thanks for pointing that out!


> https://difftastic.wilfred.me.uk/

ah, it's using tree-sitter to not bother reporting changes that have no effect.

That's very nice!

Now, of course, the biggest issue is that our DVCes still are from the paleolitic era and store source code as non-structured text files instead of trees, so we need to the proper thing "outside" the DVCS (which is using tools like diffstatic / tree-sitter: tools that have seen the light).

It's basically the old "tabs vs space" and "tabs = how many spaces?" and "bracket on the same line or not" discussions all over again. I'm pretty sure I've got comment from 15 years ago saying that in a proper world this shouldn't even be a concern because this should purely be a client-side concern, on the dev's machine. And that the DVCS should have a specific representation, not opened for discussion (a code formatter for example, but ideally just the source code already as a tree). And then no more bitchin' about tabs vs space, about how many spaces is a tab worth, on which line brackets should go, etc.

Don't get me wrong: it's great that people are doing the right thing. But it's still a kludge that's needed because the underlying tool were made by us and for us cavemen and really could have been oh so much better.


You forgot that while expression can be trees, statements are an ordered set. And most statements fits inside one line. So a diff that relies on lines gives enough information.

Also git can be made to ignore whitespace changes (a source of noise) and can refine a hunk to highlight what has changed. That’s plenty enough for most people.


Came to say this as well. Started with delta, then found difftastic.

Even better is using it via jjui, a fantastic TUI for jj vcs


Came here to say this, difftastic is great as long as you are working in a language where it understands the language tree (most languages). Getting away from diffs being focused on line changes to diffs that understand the actual language makes so much sense once you start to use it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: