←back to thread

140 points Tomte | 1 comments | | HN request time: 0.234s | source
Show context
gnuvince ◴[] No.26288322[source]
Hijacking this topic to talk about something I've been thinking about lately: literate diffs.

I find that the order of diffs given by git is not optimized for helping a reviewer understand the change. Sometimes the order of files will not be in the most logical way; sometimes unrelated changes (e.g., a text editor removing blanks at the end of lines) create noise; etc.

I've been thinking that it would be interesting to have a tool where the author can take the diff of their commit(s), order them in a way that is conducive to understanding and explain each part of the diff. That'd be similar to having the author do a code walkthrough, but at the pace of the reader rather than the author.

replies(6): >>26288537 #>>26288793 #>>26288837 #>>26289067 #>>26289125 #>>26289821 #
jonahbenton ◴[] No.26288537[source]
Take a look at the term "Semantic Source Diff", eg

https://martinfowler.com/bliki/SemanticDiff.html

Tools in this space date back to the 1990s. There is a recent upsurge of interest, a number of capable tools for different languages are currently available.

replies(1): >>26288818 #
1. briv ◴[] No.26288818[source]
Pijul gives me hope semantic diffs may become common - see the "Dependencies" paragraph of https://pijul.org/posts/2020-11-07-towards-1.0/. The HN comments on that - https://news.ycombinator.com/item?id=25032956 - are a nice read as well.