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

Cannot read property 'sha' of undefined #22

Closed
nonameolsson opened this issue Jan 7, 2017 · 10 comments
Closed

Cannot read property 'sha' of undefined #22

nonameolsson opened this issue Jan 7, 2017 · 10 comments

Comments

@nonameolsson
Copy link

The extension throws some errors i the console. This is how it looks when I open Visual Studio Code with the extension activated. I have had some problems with VS Code recently. Error messages showing up and prompting to reload window. That is how I discovered this. I do not yet know if this extension has something to do with that error message.

screen shot 2017-01-07 at 09 24 52 1

@eamodio
Copy link
Member

eamodio commented Jan 7, 2017

@nonameolsson can you set gitlens.advanced.output.level = verbose and gitlens.advanced.debug = true, and then send me the output from the GitLens output pane when the error occurs?

@nonameolsson
Copy link
Author

@eamodio Thanks, will do!

@Tyriar
Copy link

Tyriar commented Jan 15, 2017

I'm seeing this as well. It happens when settings.json is focused. This is a pretty common use case to open files that do not below to any git repository so it should be handled gracefully 😃

[Extension Host] [GitLens] getBlameForFile('/home/daniel/.config/Code - Insiders/User/settings.json', undefined, undefined)
CodeLens config changed; resetting CodeLens provider
getBlameForFile('/home/daniel/.config/Code - Insiders/User/settings.json', undefined, undefined)
Add blame cache for '/home/daniel/.config/code - insiders/user/settings.json'
git blame --root --incremental -- settings.json   cwd='/home/daniel/.config/Code - Insiders/User' 
  Error: fatal: Not a git repository (or any of the parent directories): .git  Failed with exit code: 128
Replace blame cache with empty promise for '/home/daniel/.config/code - insiders/user/settings.json'
Clear cache entry for '/home/daniel/.config/code - insiders/user/settings.json', reason=DocumentSaved
CodeLens config changed; resetting CodeLens provider
getBlameForFile('/home/daniel/.config/Code - Insiders/User/settings.json', undefined, undefined)
Add blame cache for '/home/daniel/.config/code - insiders/user/settings.json'
git blame --root --incremental -- settings.json   cwd='/home/daniel/.config/Code - Insiders/User' 
  Error: fatal: Not a git repository (or any of the parent directories): .git  Failed with exit code: 128
Replace blame cache with empty promise for '/home/daniel/.config/code - insiders/user/settings.json'
getBlameForFile('/home/daniel/dev/sourcelair/xterm.js/package.json', undefined, undefined)
Add blame cache for '/home/daniel/dev/sourcelair/xterm.js/package.json'
git blame --root --incremental -- package.json   cwd='/home/daniel/dev/sourcelair/xterm.js'
getBlameForFile('/home/daniel/.config/Code - Insiders/User/settings.json', undefined, undefined)
getBlameForFile('/home/daniel/.config/Code - Insiders/User/settings.json', undefined, undefined)
getBlameForFile('/home/daniel/.config/Code - Insiders/User/settings.json', undefined, undefined)

@eamodio
Copy link
Member

eamodio commented Jan 16, 2017

@Tyriar You are seeing the same Cannot read property 'sha' of undefined? With the same stack trace? I can't reproduce this issue - I can go through the same steps and produce practically the same output log you posted, but I never see that error (things are handled gracefully).

Is it always reproducible?

@Tyriar
Copy link

Tyriar commented Jan 16, 2017

It seemed always reproducible. Note I was on the insiders build.

@eamodio
Copy link
Member

eamodio commented Jan 16, 2017

Hrm -- I'm running today's insiders too. Can you try this build gitlens-1.4.2.zip -- I've added some more logging to trap when this happens.

(Just need to rename it back to *.vsix -- github wouldn't let me upload it otherwise)

@Tyriar
Copy link

Tyriar commented Jan 16, 2017

No reproducing now, it's probably worth adding some more defensive checks though.

@eamodio
Copy link
Member

eamodio commented Jan 26, 2017

@nonameolsson are you still experiencing this issue?

@eamodio
Copy link
Member

eamodio commented Feb 6, 2017

I think I have finally resolved this in the latest version.

@eamodio eamodio closed this as completed Feb 6, 2017
billsedison added a commit to noside911/vscode-gitlens that referenced this issue Jan 4, 2019
@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 Dec 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants