3 ms·
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/copie
by ngruhn 1y ago
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.
- VMG 1y agoPerfect. This is why I visit this website
- karczex 1y agoThanks:)
- erichocean 1y agoI 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 https://fazzone.github.io/autochrome.html
- paulhebert 1y agoI would love if GitHub implemented this in their UI! There’s and issue: https://github.com/orgs/community/discussions/9632 https://github.com/orgs/community/discussions/9632
- godelski 1y agoThat'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 https://github.com/so-fancy/diff-so-fancy