Skip to content
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

No automatic refresh of repositories that are outside of the workspace #583

Closed
michael-lang opened this issue Dec 7, 2018 · 27 comments
Closed
Assignees
Labels
bug Something isn't working needs-verification Request for community verification
Milestone

Comments

@michael-lang
Copy link

Steps:
Open the GitLens window
Use the VSCode window footer to change to another branch.
GitLens does not update the checkmark to be on the current branch.
Use the refresh button in Gitlens to update the active branch checkmark.
No change, the wrong branch still has a checkmark. In the prior version of gitlens this workaround worked. Although the workaround itself should not be needed.

Log output:
[2018-12-07 19:03:41:361] [c:/dev/Repos/eisa] git status --porcelain=v2 --branch -u • 2356 ms
[2018-12-07 19:03:41:361] [c:/dev/Repos/eisa] git status --porcelain=v2 --branch -u • 93 ms (await)
[2018-12-07 19:03:41:793] [c:/dev/Repos/eisa] git branch -vv --abbrev=40 -a • 108 ms
[2018-12-07 19:11:56:773] [c:/dev/Repos/eisa] git status --porcelain=v2 --branch -u • 96 ms
[2018-12-07 19:11:56:773] [c:/dev/Repos/eisa] git status --porcelain=v2 --branch -u • 91 ms (await)
[2018-12-07 19:11:58:606] [c:/dev/Repos/eisa] git branch -vv --abbrev=40 -a • 88 ms
[2018-12-07 19:12:04:764] [c:/dev/Repos/eisa] git status --porcelain=v2 --branch -u • 54 ms
[2018-12-07 19:12:12:888] [c:/dev/Repos/eisa] git status --porcelain=v2 --branch -u • 76 ms

Extension version: 9.0.3
VS Code version: Code 1.29.1 (bc24f98b5f70467bc689abf41cc5550ca637088e, 2018-11-15T19:13:36.375Z)
OS version: Windows_NT x64 10.0.17134

System Info
Item Value
CPUs Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz (4 x 2904)
GPU Status 2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: enabled
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
Memory (System) 15.90GB (9.38GB free)
Process Argv
Screen Reader no
VM 0%
@eamodio eamodio added the needs-more-info Needs further information, steps, details, etc. label Dec 7, 2018
@eamodio
Copy link
Member

eamodio commented Dec 7, 2018

I can't reproduce this -- when I switch branches via the status bar or command line, GitLens detects it and updates appropriately. Is there anything special about this repo? Does it happen on all repos? Are there any other details you can provide?

@michael-lang
Copy link
Author

michael-lang commented Dec 7, 2018 via email

@michael-lang
Copy link
Author

I may have confused the issue. The problem does occur still in both my current repos.

image

Notice in the screenshot the current branch is correctly reflected at the top. However, under "Branches" the checkmark is still next to the last branch I was working on. Also I just deleted a couple local branches and they are still in the branches list. Gitlens sees no commits in the branch after delete, but it doesnt realize the branch doesn't exist anymore.

Pressing the "Refresh: icon of the "Repositories" panel does not update the branches list. In a prior version of Gitlens the branches did not update automatically, but the Refresh icon did update them.

If the branches list isn't up to date, then the context menu is wrong, which prevents me from merging between branches and following the "gitflow" process.

My current workaround is to close VS code after every branch change so the branches list is up to date. Its not a very good workaround. Isn't the refresh icon supposed to update the branches?

@eamodio
Copy link
Member

eamodio commented Dec 21, 2018

@michael-lang I just released GitLens 9.2.3 which should fix the refresh issue, but I'm still at a loss to understand the root issue. Can you please reproduce the issue and send me both the steps that show the problem and the logs that go along with those steps?

@viktordd
Copy link

viktordd commented Dec 21, 2018

Hi I have the same issue.
The picture below shows the state after deleting a local branch, then creating a new branch. The branch list in gitlens is not updating. I have tried to fetch, pull, and refresh on git lens, but the Branches list does not update. You can see on the left it shows I have 2 local branches and 3 on Git Lens.
I have the latest GitLens version 9.2.3
image

@michael-lang
Copy link
Author

We use gitflow, so we have lots of branches (over 100) at origin. I usually only keep 5-10 of them locally. Maybe the number of branches is a contributing factor?

  1. open gitlens
  2. expand branches list
  3. change branches

The current branch name is changed. The branches node still shows the prior branch with a checkmark. the context menu for the prior branch is still the current branch context menu, so I can't merge that prior branch to current.

@eamodio
Copy link
Member

eamodio commented Dec 22, 2018

@michael-lang So using the refresh button with GitLens 9.2.3 didn't help? Can you provide logs please?

@eamodio
Copy link
Member

eamodio commented Dec 22, 2018

Also @michael-lang @viktordd can you also verify that this setting isn't set gitlens.views.repositories.autoRefresh to false

@michael-lang
Copy link
Author

michael-lang commented Dec 22, 2018

9.2.3 did not fix the problem I was having. But I did find the cause.

I have a git repo with multi-projects in it. At the root is a visual studio solution, which I edit using Visual Studio 2017. I also have a folder under the root for an Angular 7 project, which I open directly in VS Code. The Git repo root is at the parent folder of what I have open in VS Code.

If I open the full git repo in VSCode, then Gitlens works as expected.

repoRoot\  (open this folder in VS Code and Gitlens works)
   .git\
   .vs\
   Test.ClassLibrary\
   Test.MvcApi\
   test-ng-cli\   (open this folder in VS Code and Gitlens has the issue)

I do this because I don't want to edit C# files and try to run C# MVC APIs from VSCode. But VS Code is great for Angular projects.

@eamodio
Copy link
Member

eamodio commented Dec 22, 2018

Ah, that explains it and also why the refresh button wasn't working for you even in 9.2.3. This problem is a consequence of this issue: microsoft/vscode#3025

Until that is resolved, I will add an indicator that shows that the repo won't be automatically updated. And will ensure that caching won't be used unless I can detect repository changes.

@eamodio
Copy link
Member

eamodio commented Dec 22, 2018

@michael-lang @viktordd can you try out this build and see if it resolves the issue for you? Again GitLens still won't be able to detect the repository change (until the vscode issue is fixed), but the refresh button should work properly now. You should also see an indicator in the Repositories view when GitLens won't be able to automatically detect changes.

Please remove the .zip from the end of the file and install the vsix.
gitlens-9.2.4-beta.vsix.zip

@eamodio eamodio added blocked: vscode Caused by or dependent on a VS Code issue or feature and removed needs-more-info Needs further information, steps, details, etc. labels Dec 26, 2018
@eamodio eamodio self-assigned this Dec 26, 2018
@eamodio eamodio reopened this Dec 26, 2018
@eamodio
Copy link
Member

eamodio commented Dec 26, 2018

Reopening, since this really isn't fixed, just somewhat handled until the vscode issue is addressed.

@michael-lang
Copy link
Author

@eamodio The 9.2.4 beta does allow the refresh button to work. Thank you.

@fcharron
Copy link

fcharron commented Feb 3, 2019

@eamodio Your commit seems to falsely detect root folders from a multi-folder workspace as not being automatically updatable. I have a case where each of my root folders has its own .git folder (which is a child of the root folder), and all those folders aside from the first one I added to the workspace are marked with the new indicator.

ex:

  • Workspace
    • Folder1 --> Green
      • .git/
    • Folder2 --> Blue
      • .git/
    • Folder3 --> Blue
      • .git/
        ...

@eamodio
Copy link
Member

eamodio commented Feb 6, 2019

@fcharron Unfortunately I can't reproduce this. Can you please enable output channel logging by setting "gitlens.outputLevel": "debug" in your settings.json. This will enable logging to the GitLens channel in the Output pane. Once enabled, please reproduce the issue and attach the log lines from the GitLens channel. Thanks!

@eamodio
Copy link
Member

eamodio commented Feb 6, 2019

@fcharron Also can you please open a new issue with the info and logs -- thanks!

@fcharron
Copy link

fcharron commented Feb 8, 2019

@eamodio Well that's embarrassing, now I can't reproduce it either. If I reproduce the issue, I'll open a new bug along with the requested info.

Thanks for your great work on this most useful extension 💯

@eamodio
Copy link
Member

eamodio commented Feb 8, 2019

@fcharron Sounds good -- and thanks!

@eamodio eamodio added blocked Blocked or caused by an upstream issue or feature bug Something isn't working labels Feb 18, 2019
@eamodio eamodio changed the title Bug: Refresh does not update branches list, or mark correct branch as current No automatic refresh of repositories that are outside of the workspace Feb 18, 2019
@pedro-lb
Copy link

pedro-lb commented Oct 1, 2019

I was having the same problem, thinking it was something to do with GitLens.

Actually, I found out that my problem was due to vscode settings - I previously added **/.git to search.exclude, files.watcherExclude and files.exclude in order to improve performance.

That's what I had in my configs:

"search.exclude": {
  ...
  "**/.git": true,
  ...
},
"files.watcherExclude": {
  ...
  "**/.git": true,
  ...
},
"files.exclude": {
  ...
  "**/.git": true,
  ...
},

After removing "**/.git": true, from these 3 lists, everything went back to normal.

@fcharron perhaps you changed your settings and didn't even notice, and something was blocking GitLens from accessing or monitoring git files.

@eamodio eamodio added this to the Backlog milestone Dec 10, 2020
@eamodio eamodio removed their assignment Dec 10, 2020
@josias-r
Copy link

Still experiencing this issue in 2021, even the refresh button does not notice the branch change (weirdy though it does notice new commits when I'm on the branch on which gitlens is stuck to)

@eamodio
Copy link
Member

eamodio commented Jan 21, 2021

This should be fixed in the latest insiders edition. Can you please verify the fix works for you?

You can install the insiders edition from here. Be sure to disable/uninstall the stable version of GitLens first.

@eamodio eamodio closed this as completed Jan 21, 2021
@eamodio eamodio added needs-verification Request for community verification pending-release Resolved but not yet released to the stable edition and removed blocked Blocked or caused by an upstream issue or feature blocked: vscode Caused by or dependent on a VS Code issue or feature labels Jan 21, 2021
@eamodio eamodio self-assigned this Jan 21, 2021
@eamodio eamodio modified the milestones: Backlog, Soon™ Jan 21, 2021
@josias-r
Copy link

I just updated my insiders install and added gitlens. Still not working:
Screenshot 2021-01-21 at 08 39 11
As you can see, the repository is set to "develop", but the gitlens "commits" section still thinks, it's "master". I tried pressing the refresh button.
@eamodio

@eamodio
Copy link
Member

eamodio commented Jan 21, 2021

What version of GitLens insiders did you install?

Can you please enable output channel logging by setting "gitlens.outputLevel": "debug" in your settings.

This will enable logging to the GitLens channel in the Output pane. Once enabled, please reproduce the issue, and attach the log from the GitLens channel.

@josias-r
Copy link

Just tried to reproduce it again. It is working correctly now 🤷🏻‍♂️ Even in the non-insider edition it is working. I only restarted vscode since then (but the update was already installed, so it can't be that) and continued working with the repositories.

If it happens again, I'll follow the steps that you described 👍
For now, it is resolved on my end 😄

@eamodio eamodio modified the milestones: Soon™, Shipped Feb 3, 2021
@josias-r
Copy link

josias-r commented Feb 4, 2021

@eamodio Encountered the problem again. Here's the gitlens output that occurs when I switch the branch:

[2021-02-04 15:18:33:952] [18bf6] Repository(/users/myusername/git/myproject-styleguide/).onRepositoryChanged — e=Uri(file:///Users/myusername/git/myproject-styleguide/.git/index)
[2021-02-04 15:18:33:952] [18bf7] Repository(/users/myusername/git/myproject-styleguide/).fireChange — index
[2021-02-04 15:18:33:953] [18bf7] Repository(/users/myusername/git/myproject-styleguide/).fireChange completed • 0 ms
[2021-02-04 15:18:33:953] [18bf6] Repository(/users/myusername/git/myproject-styleguide/).onRepositoryChanged completed • 0 ms
[2021-02-04 15:18:33:953] [18bf8] Repository(/users/myusername/git/myproject-styleguide/).onRepositoryChanged — e=Uri(file:///Users/myusername/git/myproject-styleguide/.git/HEAD)
[2021-02-04 15:18:33:953] [18bf9] Repository(/users/myusername/git/myproject-styleguide/).fireChange — heads
[2021-02-04 15:18:33:953] [18bf9] Repository(/users/myusername/git/myproject-styleguide/).fireChange completed • 0 ms
[2021-02-04 15:18:33:953] [18bf8] Repository(/users/myusername/git/myproject-styleguide/).onRepositoryChanged completed • 0 ms
[2021-02-04 15:18:34:473] Repository(/users/myusername/git/myproject-styleguide/) firing changes=index, heads
[2021-02-04 15:18:34:557] [/Users/myusername/git/myproject-styleguide] git ls-files -- /Users/myusername/git/myproject-styleguide/src/lib/assets/_toolbar.scss • 83 ms 
[2021-02-04 15:18:34:558] [18bfa] GitService.isTracked returned false • 84 ms — e=GitUri(file:///Users/myusername/git/myproject-styleguide/src/lib/assets/_toolbar.scss repoPath=/Users/myusername/git/myproject-styleguide)
[2021-02-04 15:18:34:562] [/Users/myusername/git/myproject-styleguide] git ls-files -- /Users/myusername/git/myproject-styleguide/src/lib/assets/_nav.scss • 64 ms 
[2021-02-04 15:18:34:563] [18bfc] GitService.isTracked returned false • 65 ms — e=GitUri(file:///Users/myusername/git/myproject-styleguide/src/lib/assets/_nav.scss repoPath=/Users/myusername/git/myproject-styleguide)
[2021-02-04 15:18:34:563] [/Users/myusername/git/myproject-styleguide] git ls-files -- /Users/myusername/git/myproject-styleguide/src/lib/assets/scss/components/_nav.scss • 75 ms 
[2021-02-04 15:18:34:564] [18bfb] GitService.isTracked returned true • 75 ms — e=GitUri(file:///Users/myusername/git/myproject-styleguide/src/lib/assets/scss/components/_nav.scss repoPath=/Users/myusername/git/myproject-styleguide)

So the above output is logged and the branch is updated, but gitlens is still on the old branch

@eamodio
Copy link
Member

eamodio commented Feb 4, 2021

Unfortunately there isn't enough for me to go on in those logs. I can see that GitLens saw the change, but for some reason none of the UI responded to that event -- the logs prior to those might shed some light as to how/why the subscriptions were lost

@eamodio eamodio removed the pending-release Resolved but not yet released to the stable edition label Feb 9, 2021
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working needs-verification Request for community verification
Projects
None yet
Development

No branches or pull requests

6 participants