Re:Ignoring bulk change commits with Git blame (2019)
by WorldMaker on Wednesday June 30, 2021 @03:21PM
(#27692474)
I found great results using syntax highlighter token streams for diffs. In my PoC I was using Pygments. It's a great compromise for "almost semantic" diffs. Syntax highlighting tokenizers have great language support, are blazing fast (we use them constantly in real time in IDEs), and work far better in "degenerate" cases that don't entirely parse/compile yet such as work-in-progress code (again because we use them all the time in text editors).
Re:Ignoring bulk change commits with Git blame (2019)
by sdesol on Tuesday June 29, 2021 @11:17PM
(#27684464)
I was looking at https://github.com/github/semantic for providing semantic diffs a while back and I still think it would be a good fit.
By looking at the diff between trees, you can ignore a lot of the extra noise like indentations, spaces and other styling changes.
Re:Ignoring bulk change commits with Git blame (2019)
by WalterGR on Wednesday June 30, 2021 @05:08PM
(#27693432)
> I ndeed, but parsing has remained a hard (to implement properly) problem
Indeed. But there’s a perfect one (for some definition of perfect) built into every compiler. It’s a shame that more compilers don’t do things like make the AST available.
.NET Compiler Platform (“Roslyn”) is a great counter-example.
Maybe the popularity of language-servers can help bring this forward.
[1] Even smart people have trouble with it: "Amazingly, surprisingly, counterintuitively, the indentation problem is almost totally orthogonal to parsing and syntax validation." http://steve-yegge.blogspot.com/2008/03/js2-mode-new-javascr...