-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add function for calculating diff numbers of whole project #16
Comments
Thank you for the nice words. For me, the purpose of this plugin is to know whether the current buffer is "clean" i.e. whether it has uncommitted changes1 or not. If I want to know whether the repository I am working on is clean, I use So, I don't see the purpose of showing a diff of the entire repository yet but I am interested to hear more about the user scenario you are thinking about. Why would you like to see the diff of the entire repository in the statusline? |
I can always script it myself no problem. My use case is that I am trying to improve git habits and make sure I am not doing too many changes per commit. I am working on more focused commits so that my rebasing summary is cleaner And easier to remember all the changes I made along the way. Too often I do 750 plus changes per commit. I need some feedback that once that number is getting high to break off a chunk into a reasonable commit and keep going. |
This is a very good scenario/reason indeed. I will take a look at the code these days, but my guess is that implementing this will be quite easy. Probably the most complicated aspect about it is not to query git too often using the cache wisely. Have you thought about how to differentiate between the diff per buffer and diff per repository visually? My feeling is that showing both simultaneously would be visual overload. And probably there is no user scenario for that. So I'm thinking about a flag that can be swtched while editing. What are your thoughts? |
I was planning on the project level diff in my tab line and the file based one down in my status line. So either two separate functions or a flag to pass in like you mentioned |
I am still contemplating about this. So stay tuned. :) |
This needs quite some changes because at the moment
Medium-term we will need to think about the following: Probably it does not make sense to invalidate the cache for an entire repository if a single file of that repository changes. Rather only these changes should be added/subtracted from the cached values. Well, that would get really complicated then. Hm, probably the performance loss is not that big though if we invalidate on each change... Just to keep you updated and writing down my thoughts. |
The cache per repository would have the result of git rev-parse --show-toplevel as key and a (what I call) "diff dict" as values. |
There is nothing wrong with plugins being focused and doing only one thing. Especially light line plugins. I can always script this up and if I like the way it is package it up as it’s own plugin. Feel free to close this issue if you agree |
I guess it's debatable whether this should be part of this plugin or not. I think it definitely can be. Because we can leverage the "parsers" that I wrote for reading the diffs. The current code base just needs some modifications. That said, feel free to implement the feature in another plugin or send a pull request to this project. I haven't had time to implement it myself yet but I maybe will have this weekend. I'll keep you informed. |
I will poke around your plugin and see what I can make happen this weekend |
I have a couple of thoughts on how to implement this: Thought 1: Create a new algorithmCreate a separate algorithm that returns the total diff for the directory/project and basically ignores the buffer passed in. This way it plugs into (no pun intended :P) the existing architecture and I don't believe much would have to change. Maybe the easiest of my two proposals? This has the potential to be slow if the user has changes in a lot of files. Thought 2: Calculate a global
|
Thanks a lot for your thoughts. I really appreciate them! I’ll see whether I can work on this issue in the near future. It would need to be something one can opt-out to because of the performance impacts. |
@skbolton why have you closed the issue? I'd like to keep it open as reference for a feature request I find worth implementing. I haven't had time to improve the plug-in for a long time but I use is everyday still. So it's far from being abandoned. 🙂 |
First off loving this plugin great work. I have been thinking lately though that it would be nice to have a function available to calculate the diff stats of the whole project instead of only a function for the current buffer. What do you think about this?
The text was updated successfully, but these errors were encountered: