-
-
Notifications
You must be signed in to change notification settings - Fork 811
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
Some repositories fail to get status when using GitStatusCache #755
Comments
The error looks like it's in here: Lines 174 to 181 in 1a49d26
Lines 348 to 349 in 1a49d26
It seems likely the cache version ends up with a All the cache response paths are processed similarly; we should probably replace the Lines 257 to 271 in 1a49d26
|
The solution might be as simple as using |
Sorry, just noticed you said that in the issue. How about cc @cmarcusreid |
Bummed to hear you're hitting this issue! If you set $global:GitStatusCacheLoggingEnabled = $true and call Restart-GitStatusCache, it'll create a log file at %temp%\GitStatusCache_[timestamp].log. There may be a hint as to what's going wrong there. That error seems to suggest that one of the calls to libgit2 failed. See Git::GetStatus in https://github.com/cmarcusreid/git-status-cache/blob/e1ea01573e7b248c77fcb1876f04cf2f6bee2d26/src/GitStatusCache/src/Git.cpp if interested in the implementation. This code hasn't changed since 2017, but it's very possible there's something about your repository that this code can't handle. The log file would be a great starting point for investigation. I'd also be interested if you have a minimal repository that reproduces the issue. |
Thank you for jumping in! I followed your steps, and right after got a new prompt, to force the call which appears to be failing. Here is the log file. As for the second question, I don't have a repository which consistently reproduces this problem. In fact, the same exact repository (the one I've been using here) fails on one of my machines but works on the other. The only difference at all between them might be that on the one where it works, the repository had been cloned before I had GitStatusCache as part of the setup, and on the one where it doesn't, it was cloned after. It's "might be" because I honestly don't really remember. 😅 I can consistently reproduce the problem with any repository which I clone right now, in fact. It doesn't matter how old the repository itself is, if I clone (or re-clone) it right this moment, it will be broken. |
Here's the error:
I see libgit2/libgit2@5625d86, and I am guessing that git-status-cache requires an update to a more recent version of libgit2. |
Maybe try fiddling with |
That was it! I have Confirmed by setting it to I hope that git-status-cache will be updated to support the new index version, but my immediate issue is solved by simply keeping Thank you both for your help, I really appreciate it! |
I'm attempting the update now, but building libgit2 is proving tricky. I'll update when a release is available for your testing. |
I just published the v1.1.6 release of git-status-cache. This release updates libgit2 to v1.0.0. You can update by calling |
Now that we know what an Error cache response looks like, it wouldn't be terrible to handle that more gracefully than a Hashtable error. |
I agree. I will put together a PR to add a nicer error on the posh-git side later today. |
I just tested using version 1.1.6, and everything is working as expected! Both existing clones which had previously been cloned with Thank you again for the quick response and fix on this! |
Thanks for the report and help troubleshooting! |
System Details
Issue Description
I have git-status-cache-posh-client installed and working. I have posh-git configured to use it (
$GitPromptSettings.EnableFileStatusFromCache = $true
).I also have posh-git integrated into my prompt. I use it to print status information to a PowerLine block in my PowerShell profile like this:
Side note: I'm unsure if there is a better way to do this, as this was the only way I could see to get the repository information in the "prompt format" while also taking advantage of the caching. Either way, the end result, most of the time, looks like this (name blacked because it's a private org repo, sorry 😬):
However, if I clone or create a new repository on my system, then it looks like this:
If I do
Get-GitStatus
then I get a little bit more detail:And
Get-GitStatusFromCache
just bombs:I know that this is due to the caching because if I turn it off, then everything works fine. But turning it back on again results in the same problem.
I have been living with it for a long time like this, well before PowerShell 7, so I know that has nothing to do with it. I can also reproduce it on more than one machine, though they are all set up pretty much identically - same PowerShell profile, same
GitStatusCache.exe
version (the latest release), etc. Rebooting, re-cloning, removing and reinstalling git-status-cache-posh-client, and essentially every other normal troubleshooting tactic have not helped.It's also definitely fair to say that this issue might be somewhere in the caching stack, and not with posh-git itself. I am certainly happy to open an issue somewhere else if it's deemed appropriate. I guess I gravitated toward filing the issue here because the git-status-cache and git-status-cache-posh-client repositories both seem pretty lifeless at the moment.
The text was updated successfully, but these errors were encountered: