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

Blame info persistent over file change and file close #115

Open
wenfangdu opened this issue Aug 15, 2021 · 9 comments
Open

Blame info persistent over file change and file close #115

wenfangdu opened this issue Aug 15, 2021 · 9 comments
Labels

Comments

@wenfangdu
Copy link

wenfangdu commented Aug 15, 2021

Sometimes, after doing a git rebase, the git blame info is outdated, reopening the editor won't help, had to reopen the VSCode window to read the latest commit data, is there a way to force Git Blame to use the latest commit data?

If there's no way, could you please add an option to do that?

@Sertion
Copy link
Owner

Sertion commented Aug 15, 2021

Hey Wenfang Du! Thank you for the bug report.

This is very weird. I have two checks in place that should help prevent this exact behavior. Can you describe your setup a bit more?

Operating system: Windows/Linux/OSX/BSD
WSL/WSL2: Yes/No
Remote SSH folder: Yes/No
Remote folder with sync program: Yes/No
vscode version:
output from `git rev-list --all --count`: 

@Sertion Sertion added the bug label Aug 15, 2021
@Sertion Sertion changed the title How to force refresh the git blame info? Blame info persistent over file change and file close Aug 15, 2021
@wenfangdu
Copy link
Author

@Sertion

Operating system: Windows 10
WSL/WSL2: No
Remote SSH folder: No
Remote folder with sync program: No
VSCode version: v1.57.1
Output from git rev-list --all --count: 221

I was mainly doing interactive rebasing to squash and amend commits.

@wenfangdu
Copy link
Author

@Sertion I'm curious does Git Blame reobtain the commit info right after a commit? Because I just tested, even after a simple commit (e.g. edit one line), the git-blame info isn't refreshed in place, reopen the editor won't refresh either.

@Sertion
Copy link
Owner

Sertion commented Aug 19, 2021

It is very weird that reopening does not refresh the cache as there is code specifically written for that case. I use fs.watch for detecting if a file changes.

Sadly this is sort of the best available.

There is nothing in place for detecting commits right now. I don't know how easy it would be to add.

@Yottster
Copy link

Would an fs.watch on whatever file .git/HEAD points to work?

@Sertion
Copy link
Owner

Sertion commented Aug 20, 2021

Would an fs.watch on whatever file .git/HEAD points to work?

Could work. The thing to look out for in that case is that a "workspace" can have multiple folders and they can have multiple .git-folders.

@Sertion
Copy link
Owner

Sertion commented Aug 21, 2021

I might have found a fix for the issues discussed here. It would be very valuable for me if @wenfangdu could test the changes before I release them and see if they solve the issues you have experienced.

gitblame-8.2.0-prerelease-1.zip

@wenfangdu
Copy link
Author

@Sertion I'm curious does Git Blame reobtain the commit info right after a commit? Because I just tested, even after a simple commit (e.g. edit one line), the git-blame info isn't refreshed in place, reopen the editor won't refresh either.

Strange, can't reproduce it now, even with v8.1.0. I'll report if I encounter it again.

@wenfangdu
Copy link
Author

wenfangdu commented Aug 31, 2021

@Sertion Sadly, the pre-release didn't fix this issue, this time I was using VSCode v1.59.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants