Developer tool 'diff' is 40 years old: can it be improved?
stackoverflow.blog
stackoverflow.blog
Huh, vi was introduced 15 years after I first used it. Must have been inspired by vim. Think I’ll stop reading here.
Not sure if this is a llm or just lazy research.
Needless to say, private parties get a lot more leeway with me. This isn’t a mistake that would phase me on a random person’s blog, but Stackoverflow speaks with the voice of authority. They have a duty to get it right.
I highly recommend trying it out.
- This may or may not qualify, since I think GNU diff supports it with an option, as does Git diff, but "Color-words" diff can be nice, where changes in the middle of the line are highlighted and whitespace is ignored.
- Somebody already recommended https://github.com/Wilfred/difftastic, which I second. It uses treesitter and is very interesting. Surprisingly, in practice difftastic is not always noticeably better than color words diff (don't expect miracles), but occasionally it is much better.
For the last two, see Difftastic's FAQ, https://github.com/Wilfred/difftastic#isnt-this-basically---...
Update: Finally, this blog post about difftastic describes some details: https://www.wilfred.me.uk/blog/2022/09/06/difftastic-the-fan...
Update 2: Finally finally, Difftastic's wiki has more related tools: https://github.com/Wilfred/difftastic/wiki/Structural-Diffs. Difftastic's author writes many interesting things, it seems :).
https://minnie.tuhs.org/cgi-bin/utree.pl?file=V5/usr/source/...
Fix the bugs first, please.
Diff, like all the original Unix tools was only meant to do one thing, compare two files. The beauty in that being that it can be a core component of whatever you want.
UI extensions, algorithm adjustability to name some. But based on what Myers mentioned as someone else said, “improved diff” is partially a semantic diff. One that’s less cold blooded about trivial changes like white spaces.
I don’t mean to be the typical pedantic HN commenter but that sounds like a diff of commit objects rather than files.