-
Notifications
You must be signed in to change notification settings - Fork 255
async git status update blocks diagnostic and nvim quit #333
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
Comments
@rockyzhang24 I moved this to a new issue. I guess the first priority is to make sure that the status update can be cancelled so it doesn't block nvim from exiting. Blocking diagnostics happens because I limit the number of refreshes that can happen, so it's intentional that it won't start a new one while another one is still in progress. I could think about a git status update as a separate process from the rest of the refresh which has its own separate throttling. |
Okay. Thank you so much. As you know (hope you could remember me 😀), I am using a bare repo to manager my dotfiles as we deeply discussed in the original issue. This problem troubles me a lot and hope it could be easily to fix. Thanks again. |
Hi @cseickel Thanks. |
@rockyzhang24 I have done some work to reduce the amount of refreshes that happen as part of other issues that may also help with your problem. In addition to that, I just added in the ability to cancel out of the git status async update when nvim is closing. I haven't really tested it because I don't naturally have any repo slow enough to hit these issues. Can you try teh latest and let me know if there is an improvement? |
Thank you so much for your hard work 👍 I just updated neo-tree. The problem about blocking nvim quit is solved. Now when I run However, for the problem on blocking diagnostics, it is tricky. Sometimes the diagnostic will show immediately, but sometimes it won't, i.e., I have to wait a couple of seconds. I will demonstrate my situation and test in details below. I have a bare repo like this
Screen.Recording.2022-04-30.at.21.41.02-2.movIt can be observed that in the first run and the 4th run, diagnostic information was blocked and I had to wait a few seconds, but the cursor movement was still smooth, however, in the 2nd and 3rd run, the diagnostic information showed immediately. That's so weird. Any thoughts? I know my case is rather niche. I apologize sincerely if I bother you too much. I think more or less my case can be a corner case of neo-tree, and could help neo-tree more robust and shining 🤣. Thanks a lot. |
I didn't realize it was blocking all diagnostics, I originally assumed it was just not updating diagnostics in the tree. I guess it could be filling the queue that the I can try introducing pauses into the job so that other background processes can work. Can you tell me how many files each of these commands will return for you?
|
In preparation for further updates, I refactored the git status async code a little. It's possible that those changes could have a positive (or negative) effect on your problem. Could you give it a try and let me know? If it is not magically fixed, the file counts will help me to determine a good batch size if I try to break up the work and add pauses. |
Hi @cseickel , I just got up. I will turn on my laptop and run those commands now. |
So you mean run those commands in my bare repo, right? The commands I actually should run are
Thank you. |
🤯 My git status is not adding those extra arguments. If they are needed then maybe we have another issue. What happens if you just run the commands I gave you in the directory that neo-tree is working in? |
Because the bare repo is my whole
After setting this, when I open a file under If I run the |
Got it. I am adding the ability to batch the processing of these items and will include some options to fine tune the amount per batch and pause between batches. |
The latest commit changes the processing strategy from scheduling each individual line, to processing them in batches with small delays in between each batch. Here are the new options you can use to control this: require("neo-tree").setup({
git_status_async = true,
-- These options are for people with VERY large git repos
git_status_async_options = {
batch_size = 1000, -- how many lines of git status results to process at a time
batch_delay = 10, -- delay in ms between batches. Spreads out the workload to let other processes run.
max_lines = 100000, -- How many lines of git status results to process. Anything after this will be dropped.
-- Anything before this will be used. The last items to be processed are the untracked files.
},
}) You can tweak those options to figure out what works best for you. If you want to actually process everything, you'll need to increase your Give it a try and let me know how it works out and what settings you end up with. |
Sure. I’m outside and gonna try it tonight as soon as I get home. Thank you. |
Hi, sorry for my late response. I just tested it and the issue still exists. Firstly, I used the default values, i.e., Screen.Recording.2022-05-02.at.14.58.19.movThe issue happened in the last run, i.e., the diagnostic information was not displayed immediately and I have to wait for a couple of seconds. Next, I change the values to Screen.Recording.2022-05-02.at.15.03.08.movStill see my last run please. The diagnostic info was blocked again. Also, What's more, FYI I tried nvim-tree again and I found the git status and diagnostics are displayed immediately after I open nvim-tree window, or type something in the buffer, and cannot feel any delay. And no sluggishness for Screen.Recording.2022-05-02.at.15.15.49.movActually I am not care about untracked file for my bare repo. In my bare repo config, I have
Thanks a lot. |
@rockyzhang24 It would be helpful if there was actually a modified file in these tests so that I can see when the git status update is complete. Could you first save a change to the |
Sure. I added a new line at the end of Screen.Recording.2022-05-02.at.15.35.17.mov |
This option is not respected by neo-tree and I think the only real solution is to start respecting it. I just need to figure out a good way to determine if the option is set and if so, skip that check for untracked files. |
I think we can have an option to enable/disable the check for untracked files. What's more, I tested So I think for Thank you very much. |
I really don't like the timeout option, that makes it unpredictable by design. To me if you show git status you have to show it every time. I would hate to operate under the impression that there were no changed items and find out later that there were but my tree is unreliable. I'd rather it be slow and predictable than fast and inaccurate. The least I will do is offer an option to disable showing untracked files. A better choice is to add an option to disable untracked files for specific repos. My preferred option is to obey what you have configured in your gitconfig for each repo. I think that is very doable. Now that I know about the |
It makes sense. I think this is more reasonable.
This is really nice and what I want. Thank you. |
The latest in |
Thank you. I tried it and now the git status is reflected on the tree immediately after I open the tree, and the diagnostic information and nvim quit are not blocked any more. |
Hi @cseickel
Update this issue:
:qa!
to quit, but vim will be stuck there for a while. In shell, an error appears (screenshot below)I am using the latest nightly neovim and latest neotree with default config. I also found nvim-tree is very fast when fetching git status and diagnostics no matter how large the repo is. Probably you could investigate it and find a workaround.
Thank you.
Originally posted by @rockyzhang24 in #147 (comment)
The text was updated successfully, but these errors were encountered: