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

I was about to write my own tool for this but then I discovered:

   git diff --color-moved=dimmed-zebra
That shows a lot of code that was properly moved/copied in gray (even if it's an insertion). So gray stuff exactly matches something that was there before. Can also be enabled by default in the git config.


I would love if GitHub implemented this in their UI! There’s and issue: https://github.com/orgs/community/discussions/9632


I used autochrome[0] for Clojure code to do this. (I also made some improvements to show added/removed comments, top-level form moves, and within-string/within-comment edits the way GitHub does.)

At first I didn't like the color scheme and replaced it with something prettier, but then I discovered it's actually nice to have it kinda ugly, makes it easier to detect the diffs.

[0] https://fazzone.github.io/autochrome.html


That's a great solution and I'm adding it to my fallback. But also, people might be interested in diff-so-fancy[0]. I also like using batcat as a pager.

[0] https://github.com/so-fancy/diff-so-fancy


Perfect. This is why I visit this website


Thanks:)




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

Search: