Why does CodeLens always show “0 authors, 0 change

2019-01-25 08:39发布

I have a Visual Studio project/solution in a Git repo. Visual Studio's source control feature works a treat (second screenshot). Thanks "Microsoft Git Provider"

HOWEVER CodeLens shows "0 authors, 0 changes" for every class and method (first screenshot) with tooltip explanations:

no data available for this type
no data available for this method

Any ideas why it could be broken?

More detail: the git repo doesn't have remotes. Visual Studio isn't connected to any Team Foundation server. I'm using the exact version of Git that shipped with Visual Studio 2015 update 1.

>git --version
git version 2.6.2.windows.1

enter image description here enter image description here

3条回答
闹够了就滚
2楼-- · 2019-01-25 09:16

Visual Studio 2015 Update 2 fixed my problem.

https://www.visualstudio.com/en-us/news/vs2015-update2-vs.aspx

查看更多
Rolldiameter
3楼-- · 2019-01-25 09:28

I had the same problem. Tried re-installing GIT, etc. Finally, I decided to uninstall and reinstall VS 2015 with update 1, and that corrected the issue.

查看更多
4楼-- · 2019-01-25 09:40

I think the issue is not having a remote repo.

In this case without a remote repo, it won't even show up authors or changes above methods, but will show in history.

enter image description here

enter image description here

For my projects that did have a remote repo and the remote repo has since been removed it is working as intended.

The docs say that the info is taken from the local repo, but there must be some initialisation that works on the premise that there is a remote repo.

Git – CodeLens gets its indicator information from your local repo, so it doesn’t matter where your remote is. It could be Team Foundation Server, Visual Studio Online, Github, Gitorius, you name it.

Having difficulty finding out exactly, it would seem that this is linked to the remote repo.

Also the majority of my projects are not connected to TFS.

查看更多
登录 后发表回答