inner-line diff for source code, word diff for text + calculate diff from any previous commit
I really loved and used a lot your package, but I needed something that could be used not only for code development but also for collaborative document editing through git and markdown (for more info see here).
So I made some improvements:
- if you are editing source code you get inner-line diff, while if you are editing text files you get word diff (the package automatically detects the file type though Atom's grammar scopes);
- you can calculate the diff from any previous commit in the git history of the edited file (I added a drop-down menu at the beginning; the last commit is pre-selected, so if you want that you can just press enter)
(More details can be found in the updated README)
I made such improvements and heavily tested and debugged them in everyday use for more than a year together with @kappapiana (while doing both code editing and document editing), and now I can say they are ready for production use.
I designed all modifications in such a way that, from user's perspective, the package can be used exactly as before, if one is not interested in the new features (i.e. the package update would be seamless).
Under the hood, the main modification is the use of the git command to get file history, to get previous version of the file and to calculate the diff; and a new way to calculate word diff, different from the one you dismissed here 34adc10
I would like to see my improvements included in the official version of the package, so I'm available to explain more if you wish
Thank you for this. I feel this would be a great improvement. Could you give an example file and GIF comparing BEFORE and AFTER this PR to let me easily understand how diff is shown differently?
[Added below after initial msg]
Plus, I believe original inline diff doesn't depend on git binary installed on the client. If your change introduces extra effort for client to install git command, then I want make sure original behavior(works without git installation) preserved and be the default.
[Added below after initial msg] Plus, I believe original inline diff doesn't depend on
gitbinary installed on the client. If your change introduces extra effort for client to install git command, then I want make sure original behavior(works without git installation) preserved and be the default.
I finally managed to come back to this project. In my last commit, I separated features that require git binary installed, and made them optional (and disabled by default), and restored your original code to calculate diffs using the internal getLineDiffDetails method by default.
In this way, the original behavior is preserved. Only if one enables the option, git is used instead of the internal method, and one can get additional features such as commit selection from git history (with an option to automatically select user's last commit) and diff algorithm selection.
Is it OK for you?