microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.52k stars 28.66k forks source link

[Source Control] Changes not showing #225006

Open RaniAgus opened 1 month ago

RaniAgus commented 1 month ago

Type: Bug

When opening a Workspace from file, the same issue as #200387 and #201717 started happening again: for a short period of time it displays the files changed, then they disappear and I'm not able to make them appear again

vscode-bug

Does this issue occur when all extensions are disabled?: Yes

Steps to Reproduce:

  1. Make changes to a git project
  2. Open a workspace file

VS Code version: Code 1.92.0 (b1c0a14de1414fcdaa400695b4db1c0799bc3124, 2024-07-31T23:26:45.634Z) OS version: Linux x64 6.9.3-76060903-generic snap Modes:

System Info |Item|Value| |---|---| |CPUs|11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz (8 x 3799)| |GPU Status|2d_canvas: unavailable_software
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: disabled_software
multiple_raster_threads: enabled_on
opengl: disabled_off
rasterization: disabled_software
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: disabled_software
video_encode: disabled_software
vulkan: disabled_off
webgl: unavailable_software
webgl2: unavailable_software
webgpu: disabled_off
webnn: disabled_off| |Load (avg)|3, 2, 2| |Memory (System)|15.41GB (4.33GB free)| |Process Argv|--no-sandbox commons.code-workspace --crash-reporter-id 4e9421bb-649d-477d-aee0-f4cc41c682c4| |Screen Reader|no| |VM|0%| |DESKTOP_SESSION|pop| |XDG_CURRENT_DESKTOP|Unity| |XDG_SESSION_DESKTOP|pop| |XDG_SESSION_TYPE|x11|
A/B Experiments ``` vsliv368cf:30146710 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscorecescf:30445987 vscod805cf:30301675 binariesv615:30325510 vsaa593cf:30376535 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyone:30548225 962ge761:30959799 pythongtdpath:30769146 welcomedialogc:30910334 pythonnoceb:30805159 asynctok:30898717 pythonregdiag2:30936856 pythonmypyd1:30879173 2e7ec940:31000449 pythontbext0:30879054 accentitlementst:30995554 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 dsvsc021:30996838 724cj586:31013169 pythoncenvpt:31062603 a69g1124:31058053 dvdeprecation:31068756 dwnewjupytercf:31046870 newcmakeconfigv2:31071590 impr_priority:31102340 nativerepl1:31104043 refactort:31108082 ccplti:31103428 pythonrstrctxt:31103193 wkspc-onlycs-c:31111717 ```
gjsjohnmurray commented 1 month ago

Please see the Release Notes for information about turning off the new source control graph. Does that resolve your issue?

RaniAgus commented 1 month ago

@gjsjohnmurray You mean setting scm.showHistoryGraph to false? If not, please be specific about the setting you're talking about...

No, disabling that didn't fix the issue.

gjsjohnmurray commented 1 month ago

Yes, that setting. This new feature has been causing a variety of issues for some people. Thanks for having ruled it out as the cause of yours.

RaniAgus commented 1 month ago

Sorry, I said, it did not fix the issue.

gjsjohnmurray commented 1 month ago

Sorry, I said, it did not fix the issue.

Yes, that's what I understood. That's why I wrote "ruled it out".

lszomoru commented 1 month ago

@RaniAgus, could you please run git status in the integrated terminal and share the output? Thank you!

maximeb97 commented 1 month ago

Please see the Release Notes for information about turning off the new source control graph. Does that resolve your issue?

Had similar issue, disabling scm.showHistoryGraph fixed the problem for me

rianquinn commented 1 month ago

I am having the same problem, and turning this off did NOT help. That being said, it was working fine for me, but I was also having the performance issue with this graph feature. Once I turned this feature off, source control broke and now I see nothing (turning it back on did not fix this either). git status on the command line works fine, but I am seeing this in the output window:

"fatal: not a git repository (or any of the parent directories): .git"

Please release a version of VSCode that reverts these changes until they actually work. This is a critical component to VSCode that is basically broken.

RaniAgus commented 1 month ago

@RaniAgus, could you please run git status in the integrated terminal and share the output? Thank you!

Sure @lszomoru!

$ git status
On branch feat/string-safe-config
Your branch is up to date with 'origin/feat/string-safe-config'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   src/commons/string.c

no changes added to commit (use "git add" and/or "git commit -a")

Also tried some of the commands in debug console:

$ git status -z -uall
 M src/commons/string.c%
$ git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) refs/heads/origin/master refs/remotes/origin/master

# For bash:
bash: syntax error near unexpected token `('

# For zsh:
zsh: no matches found: --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref)
RaniAgus commented 1 month ago

Follow up: I think this is related to having git submodules in a repository. After deleting the submodule folder with rm -rf, I'm able to see the source control again: image

Also tried to reproduce in older versions of VSCode (1.91.1-1720564633, 1.90.2-1718751586, 1.89.1-1715060508, 1.82.3-1696245001, 1.80.2-1690491597) and it's still reproducible, so it's probably not related to latest changes.

Example repo: https://github.com/sisoputnfrba/so-commons-library

Abhinav4279 commented 1 month ago

Was having the same issue, had to revert back to older version of vscode. That is working fine and doesn't seem to cause the issue: https://update.code.visualstudio.com/1.89.1/linux-deb-x64/stable

gjsjohnmurray commented 1 month ago

@Abhinav4279 did disabling disabling scm.showHistoryGraph not help you?

Abhinav4279 commented 1 month ago

Didn't test earlier, came across this thread later. Yes disabling scm.showHistoryGraph resolved the issue, just tested on latest version.

lszomoru commented 4 weeks ago

@RaniAgus, thank you very much for sharing the information and for investigating this further. Based on your findings, the behaviour that you are seeing any unrelated to the new history graph feature so I would like to keep this issue scoped to that.

@rianquinn, could you please create a separate issue so that I can investigate the behaviour that you are seeing? Thanks!

matekelemen commented 2 weeks ago

Had the same problem and I also have several submodules (a big one too) in the repository, but disabling scm.showHistoryGraph fixed it for me (after reloading of course).

alaincao commented 2 weeks ago

Hi, same issue here (1.92.2 Linux), but I have no submodule in that repository, and AFAICT, I see no reference to any submodule in my .git/ ...

unsetting typescript.tsserver.experimental.useVsCodeWatcher has no effect (as suggested in #226958). OTOH, unsetting scm.showHistoryGraph is a valid work around for me.

ok, while testing things to write this issue, I think I can reproduce simply by removing the "origin" remote ; recreating it fixes So I think this is related (for me at least) to #224494 because I have the same error message described in that issue, and it seems it appears only in the problematic repositories: fatal: ref refs/remotes/origin/HEAD is not a symbolic ref

This is the "Git" output (log level "Trace") appearing when I click the refresh button on the "Source control repositories"

2024-08-31 02:16:28.579 [trace] [OperationManager][start] Refresh (blocking: false, readOnly: false; retry: false; showProgress: true)
2024-08-31 02:16:28.593 [info] > git config --get commit.template [7ms]
2024-08-31 02:16:28.594 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) refs/heads/reactjs-baseapp refs/remotes/reactjs-baseapp [1ms]
2024-08-31 02:16:28.604 [info] > git status -z -uall [3ms]
2024-08-31 02:16:28.611 [trace] [GitHistoryProvider][onDidRunGitStatus] HEAD: {"type":0,"name":"reactjs-baseapp","commit":"4f5cde2976e846f74ebf89eed100d8ec39ea313a","ahead":0,"behind":0}
2024-08-31 02:16:28.611 [trace] [GitHistoryProvider][onDidRunGitStatus] repository.HEAD: {"type":0,"name":"reactjs-baseapp","commit":"4f5cde2976e846f74ebf89eed100d8ec39ea313a","ahead":0,"behind":0}
2024-08-31 02:16:28.611 [trace] [OperationManager][start] GetBranch (blocking: false, readOnly: true; retry: false; showProgress: false)
2024-08-31 02:16:28.616 [trace] [OperationManager][end] Refresh (blocking: false, readOnly: false; retry: false; showProgress: true)
2024-08-31 02:16:28.617 [trace] [GitHistoryProvider][onDidRunGitStatus] HEAD: {"type":0,"name":"reactjs-baseapp","commit":"4f5cde2976e846f74ebf89eed100d8ec39ea313a","ahead":0,"behind":0}
2024-08-31 02:16:28.617 [trace] [GitHistoryProvider][onDidRunGitStatus] repository.HEAD: {"type":0,"name":"reactjs-baseapp","commit":"4f5cde2976e846f74ebf89eed100d8ec39ea313a","ahead":0,"behind":0}
2024-08-31 02:16:28.617 [trace] [OperationManager][start] GetBranch (blocking: false, readOnly: true; retry: false; showProgress: false)
2024-08-31 02:16:28.618 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) refs/heads/reactjs-baseapp refs/remotes/reactjs-baseapp [2ms]
2024-08-31 02:16:28.618 [trace] [OperationManager][end] GetBranch (blocking: false, readOnly: true; retry: false; showProgress: false)
2024-08-31 02:16:28.623 [trace] [OperationManager][start] Config (blocking: false, readOnly: true; retry: false; showProgress: false)
2024-08-31 02:16:28.624 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) refs/heads/reactjs-baseapp refs/remotes/reactjs-baseapp [14ms]
2024-08-31 02:16:28.624 [trace] [OperationManager][end] GetBranch (blocking: false, readOnly: true; retry: false; showProgress: false)
2024-08-31 02:16:28.630 [trace] [OperationManager][start] Config (blocking: false, readOnly: true; retry: false; showProgress: false)
2024-08-31 02:16:28.631 [info] > git config --local branch.reactjs-baseapp.vscode-merge-base [1ms]
2024-08-31 02:16:28.631 [warning] [Git][config] git config failed: Failed to execute git
2024-08-31 02:16:28.631 [trace] [OperationManager][end] Config (blocking: false, readOnly: true; retry: false; showProgress: false)
2024-08-31 02:16:28.636 [info] > git config --local branch.reactjs-baseapp.vscode-merge-base [13ms]
2024-08-31 02:16:28.636 [warning] [Git][config] git config failed: Failed to execute git
2024-08-31 02:16:28.636 [trace] [OperationManager][end] Config (blocking: false, readOnly: true; retry: false; showProgress: false)
2024-08-31 02:16:28.643 [info] > git reflog reactjs-baseapp --grep-reflog=branch: Created from *. [7ms]
2024-08-31 02:16:28.651 [info] > git symbolic-ref --short refs/remotes/origin/HEAD [3ms]
2024-08-31 02:16:28.651 [info] fatal: ref refs/remotes/origin/HEAD is not a symbolic ref
2024-08-31 02:16:28.651 [trace] [GitHistoryProvider][onDidRunGitStatus] HEAD has not changed
2024-08-31 02:16:28.651 [info] > git reflog reactjs-baseapp --grep-reflog=branch: Created from *. [10ms]
2024-08-31 02:16:28.657 [info] > git symbolic-ref --short refs/remotes/origin/HEAD [1ms]
2024-08-31 02:16:28.657 [info] fatal: ref refs/remotes/origin/HEAD is not a symbolic ref
2024-08-31 02:16:28.657 [trace] [GitHistoryProvider][onDidRunGitStatus] currentHistoryItemGroup(true): {"id":"refs/heads/reactjs-baseapp","name":"reactjs-baseapp","revision":"4f5cde2976e846f74ebf89eed100d8ec39ea313a"}
lszomoru commented 1 week ago

@alaincao, thanks for the additional information. Are you saying that setting scm.showHistoryGraph to false resolved the issue for you? The error that occurs while running git symbolic-ref --short refs/remotes/origin/HEAD is valid but it is part of us detecting the merge base for your branch so even if the command fails, I would still expect things to work.

Having said that, we have completely changed the history graph in the upcoming release so you can try it out already in the latest VS Code Insiders release. The VS Code stable release is expected to be available later this week.

alaincao commented 1 week ago

"Are you saying that setting scm.showHistoryGraph to false resolved the issue" yes.

My guess is that a crash while creating that "History view" breaks the whole "Source Control" tab, and so hiding it works around.

alaincao commented 1 week ago

@lszomoru, fyi, I just made a quick test with the insider version and things seem to be working correctly for me with it (and the UI is waaay better!)