microsoft / vscode

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

Git relative path not found #202565

Open bpasero opened 10 months ago

bpasero commented 10 months ago

Seeing this in my insiders:

console.ts:137 [Extension Host] rejected promise not handled within 1 second: Git relative path not found. Was looking for src/vs/workbench/services/notebook/common/notebookdocumentservice.ts among [] {} (at console.<anonymous> (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:143:168559))
p @ console.ts:137
console.ts:137 [Extension Host] stack trace: Error: Git relative path not found. Was looking for src/vs/workbench/services/notebook/common/notebookdocumentservice.ts among []
    at B.getGitRelativePath (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/git/dist/main.js:2:897744)
    at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/git/dist/main.js:2:989825
    at P.db (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/git/dist/main.js:2:993309)
    at P.cb (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/git/dist/main.js:2:993001)
    at P.show (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/git/dist/main.js:2:989532) (at console.<anonymous> (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:143:168559))
p @ console.ts:137
mainThreadExtensionService.ts:81 [vscode.git]Git relative path not found. Was looking for src/vs/workbench/services/notebook/common/notebookdocumentservice.ts among []
$onExtensionRuntimeError @ mainThreadExtensionService.ts:81
mainThreadExtensionService.ts:82 Error: Git relative path not found. Was looking for src/vs/workbench/services/notebook/common/notebookdocumentservice.ts among []
    at B.getGitRelativePath (vscode-file://vscode-app/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/git/dist/main.js:2:897744)
    at vscode-file://vscode-app/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/git/dist/main.js:2:989825
    at P.db (vscode-file://vscode-app/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/git/dist/main.js:2:993309)
    at P.cb (vscode-file://vscode-app/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/git/dist/main.js:2:993001)
    at P.show (vscode-file://vscode-app/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/git/dist/main.js:2:989532)
$onExtensionRuntimeError @ mainThreadExtensionService.ts:82
console.ts:137 [Extension Host] rejected promise not handled within 1 second: Git relative path not found. Was looking for src/vs/workbench/services/notebook/common/notebookdocumentservice.ts among [] {} (at console.<anonymous> (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:143:168559))
p @ console.ts:137
console.ts:137 [Extension Host] stack trace: Error: Git relative path not found. Was looking for src/vs/workbench/services/notebook/common/notebookdocumentservice.ts among []
    at B.getGitRelativePath (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/git/dist/main.js:2:897744)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/git/dist/main.js:2:989825
    at P.db (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/git/dist/main.js:2:993309)
    at P.cb (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/git/dist/main.js:2:993001)
    at P.show (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/git/dist/main.js:2:989532) (at console.<anonymous> (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:143:168559))
p @ console.ts:137
mainThreadExtensionService.ts:81 [vscode.git]Git relative path not found. Was looking for src/vs/workbench/services/notebook/common/notebookdocumentservice.ts among []
$onExtensionRuntimeError @ mainThreadExtensionService.ts:81
mainThreadExtensionService.ts:82 Error: Git relative path not found. Was looking for src/vs/workbench/services/notebook/common/notebookdocumentservice.ts among []
    at B.getGitRelativePath (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/git/dist/main.js:2:897744)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/git/dist/main.js:2:989825
    at P.db (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/git/dist/main.js:2:993309)
    at P.cb (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/git/dist/main.js:2:993001)
    at P.show (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/git/dist/main.js:2:989532)
lszomoru commented 10 months ago

The issue can be reproduced when opening a pull request (ex: https://github.com/microsoft/vscode/tree/ben/smoke-playwright) that contains files that are added. The GHPRI extension would call show() in the git extension for each file from the PR but the git extension throws as the files do not exist in the parent commit.

alexr00 commented 8 months ago

@lszomoru the problem in GHPR is exactly as you describe. I've added an "is add" check there to prevent this from happening. Feel free to close if you feel this is enough of a fix!

lszomoru commented 8 months ago

@alexr00, thank you! Will keep it open as I want to see if there is need to change the behaviour of the git file system provider.