5 ms·
One thing that especially git fails at, is content that’s been moved around. Moving content is a simple and powerful editorial tool, but it starts to make any s
by lyjackal 3y ago
One thing that especially git fails at, is content that’s been moved around. Moving content is a simple and powerful editorial tool, but it starts to make any simple diff incomprehensible, showing large sections as added and removed.
Curious if you’ve thought about attacking this problem, or have seen any other tools that solve it elegantly?
- dash2 3y agoThat's a really interesting point, I'll think about it. There's a tension between "making it clear what the change is" and "making it clear what the old and new versions are". One approach would be something like --[MOVED X: blah blah blah]-- ... +[FROM X: blah blah blah]++. A more radical one is --[>>>]-- ... ++[<<< blah blah blah]++ where you actually delete the content from its old position, leaving only a marker.
- SOLAR_FIELDS 3y agoIsn’t the latter one how git works? I think one difficulty with the former from git’s POV is that it’s difficult to divine the difference between moves and add/delete without the end user explicitly specifying that they’ve “moved” a file. One easy to grok example is moving a file to one location and creating a copy of that file in another location in that same diff. Perhaps in this approach that same limitation does not exist