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

If you use vim, try the fugitive plugin[1]. You can do :Gdiff to see side-by-side diff between what is staged and the working tree. It provides some context, but if you need more you can unfold it.

[1] https://github.com/tpope/vim-fugitive



More generically, many diff viewers exist, and certainly help understand what is going on with a diff, in a side by side comparison. However, in a multi-file refactoring, sometimes this can still be a bit tricky. Say for instance you split one method into 3 smaller methods that are somewhat inter-dependent (you have x(), but now it is a(), b(), c(), and you sometimes call a(); c() and sometimes b(); c(), and sometimes just c()); in that case you have a complex diff that is hard to make sure everything is correct in. Even if you can turn it into a series of changes keeping x() as a wrapper around a(), b() and c(), you'll frequently end up with several multi-file diffs to look at as you migrate.

I somewhat agree with the author, that maybe there is some better change viewing paradigm we aren't seeing for these complex cases, that could benefit everyone.




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

Search: