vscode-gitstash icon indicating copy to clipboard operation
vscode-gitstash copied to clipboard

I have installed the extension and don't see any of the stashes

Open gregviolette opened this issue 2 years ago • 8 comments

I have this extension installed on my Ubuntu VM and it works fine. But when I installed it on my Windows 11 VS Code, I don't see the "STASHES" panel in the Explorer. What am I doing wrong?

gregviolette avatar Oct 27 '23 13:10 gregviolette

Try right clicking on the SCM title (Source control), in the revealed menu select Stashes to enable the view. If that entry doesn't appear, verify that the Explorer: Enabled setting is active.

artrz avatar Nov 07 '23 04:11 artrz

Same problem here, under Linux. The explorer doesn't appear and that entry doesn't exist. Enabled setting is On by default. Extension log file is totally empty. Added a keybinding to Toggle Explorer and that doesn't do anything either.

res359 avatar Nov 12 '23 09:11 res359

I think I figured it out. I ran the extension in a debug session and got a stacktrace:

rejected promise not handled within 1 second: Error: ENOENT: no such file or directory, stat '/home/user/projects/test/does-not-exist'
stack trace: Error: ENOENT: no such file or directory, stat '/home/user/projects/test/does-not-exist'
        at statSync (node:fs:1615:3)
        at t.statSync (node:electron/js2c/asar_bundle:2:4557)
        at /home/user/git/vscode-gitstash/dist/extension.js:6965:28
        at Array.forEach (<anonymous>)
        at Workspace.getSubdirectoriesTree (/home/user/git/vscode-gitstash/dist/extension.js:6962:38)
        at /home/user/git/vscode-gitstash/dist/extension.js:6933:46
        at Array.forEach (<anonymous>)
        at Workspace.getSubRootPaths (/home/user/git/vscode-gitstash/dist/extension.js:6932:24)
        at Workspace.getRootPaths (/home/user/git/vscode-gitstash/dist/extension.js:6894:30)
        at WorkspaceGit.getRepositories (/home/user/git/vscode-gitstash/dist/extension.js:5983:47)
        at activate (/home/user/git/vscode-gitstash/dist/extension.js:7287:80)
        at H._callActivateOptional (/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:136:16961)
        at H._callActivate (/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:136:16631)
        at /usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:136:14456
        at async w._activate (/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:125:7861)
        at async w._waitForDepsThenActivate (/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:125:7803)
        at async w._initialize (/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:125:7167)

The problem is caused by a stashed commit referencing a folder that doesn't exist anymore. Recreating the missing folder makes everything work correctly. Code should be fixed to ignore stat errors.

res359 avatar Nov 16 '23 09:11 res359

@res359 Thank you very much for taking time to debug it on you side. I'll update the extension as soon as got some free time.

artrz avatar Nov 17 '23 17:11 artrz

@res359 Could you tell me the steps to reproduce it, including any custom settings? I'd rather fix after reproducing it than just blindly fixing it based on the trace.

artrz avatar Nov 21 '23 00:11 artrz

@artrz Turns out I was slightly mistaken. The problem is simply caused by having a broken symlink in your repository folder. Just create one with ln -s foobar test. It doesn't have to be referenced by a stashed commit. The extension will stop working immediately.

@gregviolette originally reported the problem under Windows and not Linux, so I wonder if it's the same issue even.

res359 avatar Nov 21 '23 07:11 res359

Ah that makes sense @res359! Tried using directories and wasn't unable to reproduce. While I don't expect the symlink thing to fix the issue from OP still a bug so I'll fix it soon.

@gregviolette could you start a debug session on your side to catch any possible trace? I already found a possible issue but not sure if related to you case.

artrz avatar Nov 22 '23 02:11 artrz

Hi @res359 @artrz , I'm also not able to see the "STASHES" panel in the Explorer since sometime on macOS Sonoma 14.7 Running in debug session gives missing file error.

Could not read source map for file:///Users/akvabhi/.vscode/extensions/arturock.gitstash-5.2.0/dist/extension.js: ENOENT: no such file or directory, open '/Users/akvabhi/.vscode/extensions/arturock.gitstash-5.2.0/dist/extension.js.map'

On checking manually, the extensions.js file is present but no file named extension.js.map

I also tried to reinstall the extension but it didn't help. However the commands to show stash etc are working correctly.

Akv2021 avatar Oct 29 '24 12:10 Akv2021