Vscode-gitlens: Git lens shows uncommited everywhere

Created on 8 Apr 2017  路  17Comments  路  Source: eamodio/vscode-gitlens

I have an git repo, when I opened it in Visual Studio Code, your extension shows that all code is uncommitted like on that screenshot:
screenshot 199

This file is changed so some lines are uncommitted, but there is a previous revision with number 599c3dcc. So in fact those lines are unchanged should have proper revision number. This is comparison done by git in Visual Studio Code on the same file:
screenshot 200

Visual Studio Code version: 1.11.1
GitLens: 3.2.1

needs more info

Most helpful comment

For what it's worth, I ran into a similar issue, but it turned out to be due to line endings -- locally I was using CRLF on a Windows machine with GitHub Desktop, but the files were actually originally LF.

Once I switched my document from CRLF to LF, the issue went away.

All 17 comments

@mklemarczyk Is this only with this particular file? Do you have a public repo that reproduces this issue?

@eamodio It occurs in all files in that repo. Only if I commit changes with extension enabled it can trace only that particular commit.

My repo is a local GIT repo without any origins.

@mklemarczyk I can't seem to reproduce this behavior and I'm not sure I'm following. Can you walk me through the exact steps to reproduce this?

Here is some log from GIT:

Using git 2.10.0.windows.1 from C:\Program Files\Git\cmd\git.exe
git rev-parse --show-toplevel
git rev-parse --show-toplevel
git fetch
git status -z -u
git config --get commit.template
fatal: No remote repository specified.  Please, specify either a URL or a
remote name from which new revisions should be fetched.


git symbolic-ref --short HEAD
git rev-parse issue/9-enha
git rev-parse --symbolic-full-name --abbrev-ref issue/9-enha@{u}
fatal: no upstream configured for branch 'issue/9-enha'

git for-each-ref --format %(refname) %(objectname)
git remote --verbose
git show :backend/controllers/poll/poll/fill-out.php
fatal: Path 'backend/controllers/poll/poll/fill-out.php' exists on disk, but not in the index.

git show :backend/controllers/poll/poll/fill-out.php
git show :backend/controllers/poll/poll/fill-out.php
fatal: Path 'backend/controllers/poll/poll/fill-out.php' exists on disk, but not in the index.

fatal: Path 'backend/controllers/poll/poll/fill-out.php' exists on disk, but not in the index.

git show HEAD:backend/controllers/PollController.php
git show :backend/controllers/PollController.php
git show HEAD:backend/controllers/PollController.php
git show :backend/controllers/PollController.php
git show HEAD:backend/controllers/PollController.php
git show :backend/controllers/poll/poll/fill-out.php
fatal: Path 'backend/controllers/poll/poll/fill-out.php' exists on disk, but not in the index.

git show :backend/controllers/poll/poll/index.php
fatal: Path 'backend/controllers/poll/poll/index.php' exists on disk, but not in the index.

git show :backend/controllers/PollOptionController.php
git status -z -u
git symbolic-ref --short HEAD
git rev-parse issue/9-enha
git rev-parse --symbolic-full-name --abbrev-ref issue/9-enha@{u}
fatal: no upstream configured for branch 'issue/9-enha'

git for-each-ref --format %(refname) %(objectname)
git remote --verbose
git show :backend/controllers/PollOptionController.php
git show :backend/controllers/PollQuestionController.php
git status -z -u
git symbolic-ref --short HEAD
git rev-parse issue/9-enha
git rev-parse --symbolic-full-name --abbrev-ref issue/9-enha@{u}
fatal: no upstream configured for branch 'issue/9-enha'

git for-each-ref --format %(refname) %(objectname)
git remote --verbose
git show :backend/controllers/PollQuestionController.php
git status -z -u
git symbolic-ref --short HEAD
git rev-parse issue/9-enha
git rev-parse --symbolic-full-name --abbrev-ref issue/9-enha@{u}
fatal: no upstream configured for branch 'issue/9-enha'

git for-each-ref --format %(refname) %(objectname)
git remote --verbose

Unfortunately your extension does not print any outcome to the Extensions console.

On small repo it works, but it does not work on reported repository. I use GIT Flow features and SourceTree for repo management.

Sorry, I stop working when I switch back to the testing small repo.

Using git 2.10.0.windows.1 from C:\Program Files\Git\cmd\git.exe
git rev-parse --show-toplevel
git rev-parse --show-toplevel
git config --get commit.template
git fetch
git status -z -u

fatal: No remote repository specified.  Please, specify either a URL or a
remote name from which new revisions should be fetched.

git symbolic-ref --short HEAD
git rev-parse feature/NewFeature1
git rev-parse --symbolic-full-name --abbrev-ref feature/NewFeature1@{u}
fatal: no upstream configured for branch 'feature/NewFeature1'

git for-each-ref --format %(refname) %(objectname)
git remote --verbose
git show :zad1_test.py
git show :zad1.py

I'd created a branch named: "feature/NewFeature1"

@mklemarczyk if you set "gitlens.advanced.output.level": "verbose" in your settings GitLens will output to a GitLens channel in the Output window

Log from current version

GitLens(v3.4.5) active: d:/Web/root-users/meeting
Git found: 2.10.0.windows.1 @ PATH
git rev-parse --show-toplevel   cwd='d:/Web/root-users/meeting'
Git version: 2.10.0.windows.1
CodeLens config changed; resetting CodeLens provider
getLogForFile('undefined', 'd:\Web\root-users\meeting\backend\controllers\EventController.php', undefined, 1, undefined, false)
getLogForFile('undefined', 'd:\Web\root-users\meeting\backend\controllers\EventController.php', undefined, 1, undefined, false)
getLogForFile('undefined', 'd:\Web\root-users\meeting\backend\controllers\EventController.php', undefined, 1, undefined, false)
getLogForFile('undefined', 'd:\Web\root-users\meeting\backend\controllers\EventController.php', undefined, 1, undefined, false)
git log --name-status --full-history -M --date=iso8601 --format=%H -%nauthor %an%nauthor-date %ai%nparents %P%nsummary %B%nfilename ? --follow -n1 --no-merges -- EventController.php   cwd='d:/Web/root-users/meeting/backend/controllers'
isFileUncommitted('d:/Web/root-users/meeting/', 'd:\Web\root-users\meeting\backend\controllers\EventController.php')
git log --name-status --full-history -M --date=iso8601 --format=%H -%nauthor %an%nauthor-date %ai%nparents %P%nsummary %B%nfilename ? --follow -n1 --no-merges -- EventController.php   cwd='d:/Web/root-users/meeting/backend/controllers'
isFileUncommitted('d:/Web/root-users/meeting/', 'd:\Web\root-users\meeting\backend\controllers\EventController.php')
git log --name-status --full-history -M --date=iso8601 --format=%H -%nauthor %an%nauthor-date %ai%nparents %P%nsummary %B%nfilename ? --follow -n1 --no-merges -- EventController.php   cwd='d:/Web/root-users/meeting/backend/controllers'
getBlameForFile('d:/Web/root-users/meeting/', 'd:\Web\root-users\meeting\backend\controllers\EventController.php', undefined)
Add blame cache for 'd:/web/root-users/meeting/backend/controllers/eventcontroller.php'
getLogForFile('undefined', 'extension-output-#2', undefined, 1, undefined, false)
git ls-files d:\Web\root-users\meeting\backend\controllers\EventController.php   cwd='d:/Web/root-users/meeting/'
git log --name-status --full-history -M --date=iso8601 --format=%H -%nauthor %an%nauthor-date %ai%nparents %P%nsummary %B%nfilename ? --follow -n1 --no-merges -- EventController.php   cwd='d:/Web/root-users/meeting/backend/controllers'
getBlameForFile('d:/Web/root-users/meeting/', 'd:\Web\root-users\meeting\backend\controllers\EventController.php', undefined)
git ls-files d:\Web\root-users\meeting\backend\controllers\EventController.php   cwd='d:/Web/root-users/meeting/'
git blame --root --incremental -- backend/controllers/EventController.php   cwd='d:/Web/root-users/meeting/'
GitCodeLensProvider.provideCodeLenses: 0 symbol(s) found
git log --name-status --full-history -M --date=iso8601 --format=%H -%nauthor %an%nauthor-date %ai%nparents %P%nsummary %B%nfilename ? --follow -n1 --no-merges -- extension-output-#2   cwd='.' 
  Error: fatal: Not a git repository (or any of the parent directories): .git  Failed with exit code: 128
isFileUncommitted('d:/Web/root-users/meeting', 'extension-output-#2')
git ls-files extension-output-#2   cwd='d:/Web/root-users/meeting'
getLogForFile('undefined', 'd:\Web\root-users\meeting\backend\controllers\EventController.php', undefined, 1, undefined, false)
getLogForFile('undefined', 'd:\Web\root-users\meeting\backend\controllers\EventController.php', undefined, 1, undefined, false)
getBlameForRangeSync('d:/Web/root-users/meeting/', 'd:\Web\root-users\meeting\backend\controllers\EventController.php', [0, 174], undefined)
git log --name-status --full-history -M --date=iso8601 --format=%H -%nauthor %an%nauthor-date %ai%nparents %P%nsummary %B%nfilename ? --follow -n1 --no-merges -- EventController.php   cwd='d:/Web/root-users/meeting/backend/controllers'
isFileUncommitted('d:/Web/root-users/meeting/', 'd:\Web\root-users\meeting\backend\controllers\EventController.php')
git log --name-status --full-history -M --date=iso8601 --format=%H -%nauthor %an%nauthor-date %ai%nparents %P%nsummary %B%nfilename ? --follow -n1 --no-merges -- EventController.php   cwd='d:/Web/root-users/meeting/backend/controllers'
getBlameForFile('d:/Web/root-users/meeting/', 'd:\Web\root-users\meeting\backend\controllers\EventController.php', undefined)
git ls-files d:\Web\root-users\meeting\backend\controllers\EventController.php   cwd='d:/Web/root-users/meeting/'
getLogForFile('undefined', 'extension-output-#2', undefined, 1, undefined, false)
git log --name-status --full-history -M --date=iso8601 --format=%H -%nauthor %an%nauthor-date %ai%nparents %P%nsummary %B%nfilename ? --follow -n1 --no-merges -- extension-output-#2   cwd='.' 
  Error: fatal: Not a git repository (or any of the parent directories): .git  Failed with exit code: 128
isFileUncommitted('d:/Web/root-users/meeting', 'extension-output-#2')
git ls-files extension-output-#2   cwd='d:/Web/root-users/meeting'
getLogForFile('undefined', 'd:\Web\root-users\meeting\backend\controllers\EventController.php', undefined, 1, undefined, false)
getLogForFile('undefined', 'd:\Web\root-users\meeting\backend\controllers\EventController.php', undefined, 1, undefined, false)
git log --name-status --full-history -M --date=iso8601 --format=%H -%nauthor %an%nauthor-date %ai%nparents %P%nsummary %B%nfilename ? --follow -n1 --no-merges -- EventController.php   cwd='d:/Web/root-users/meeting/backend/controllers'
isFileUncommitted('d:/Web/root-users/meeting/', 'd:\Web\root-users\meeting\backend\controllers\EventController.php')
git log --name-status --full-history -M --date=iso8601 --format=%H -%nauthor %an%nauthor-date %ai%nparents %P%nsummary %B%nfilename ? --follow -n1 --no-merges -- EventController.php   cwd='d:/Web/root-users/meeting/backend/controllers'
getBlameForFile('d:/Web/root-users/meeting/', 'd:\Web\root-users\meeting\backend\controllers\EventController.php', undefined)
git ls-files d:\Web\root-users\meeting\backend\controllers\EventController.php   cwd='d:/Web/root-users/meeting/'
getLogForFile('undefined', 'extension-output-#2', undefined, 1, undefined, false)
git log --name-status --full-history -M --date=iso8601 --format=%H -%nauthor %an%nauthor-date %ai%nparents %P%nsummary %B%nfilename ? --follow -n1 --no-merges -- extension-output-#2   cwd='.' 
  Error: fatal: Not a git repository (or any of the parent directories): .git  Failed with exit code: 128
isFileUncommitted('d:/Web/root-users/meeting', 'extension-output-#2')
git ls-files extension-output-#2   cwd='d:/Web/root-users/meeting'

I have the same issue. Oddly enough, on my laptop, with the same repo, repo management tools and VSCode setup (identical extensions + settings), it works fine. It's possible that something in the repo's .git folder got hit at some point, though.

Output from logger:

GitLens(v3.4.9) active: c:/GitHub/Skull132/Aurora.3
Git found: 2.7.4.windows.1 @ C:\Program Files\Git\cmd\git.exe
git rev-parse --show-toplevel   cwd='c:/GitHub/Skull132/Aurora.3'
Git version: 2.7.4.windows.1
CodeLens config changed; resetting CodeLens provider
getLogForFile('undefined', 'input', undefined, 1, undefined, false)
getLogForFile('undefined', 'input', undefined, 1, undefined, false)
git log --name-status --full-history -M --date=iso8601 --format=%H -%nauthor %an%nauthor-date %ai%nparents %P%nsummary %B%nfilename ? --follow -n1 --no-merges -- input   cwd='.' 
  Error: fatal: Not a git repository (or any of the parent directories): .git  Failed with exit code: 128
isFileUncommitted('c:/GitHub/Skull132/Aurora.3', 'input')
git log --name-status --full-history -M --date=iso8601 --format=%H -%nauthor %an%nauthor-date %ai%nparents %P%nsummary %B%nfilename ? --follow -n1 --no-merges -- input   cwd='.' 
  Error: fatal: Not a git repository (or any of the parent directories): .git  Failed with exit code: 128
isFileUncommitted('c:/GitHub/Skull132/Aurora.3', 'input')
git ls-files input   cwd='c:/GitHub/Skull132/Aurora.3'
git ls-files input   cwd='c:/GitHub/Skull132/Aurora.3'
getLogForFile('undefined', 'c:\GitHub\Skull132\Aurora.3\code\modules\projectiles\projectile.dm', undefined, 1, undefined, false)
getLogForFile('undefined', 'c:\GitHub\Skull132\Aurora.3\code\modules\projectiles\projectile.dm', undefined, 1, undefined, false)
getLogForFile('undefined', 'extension-output-#2', undefined, 1, undefined, false)
git log --name-status --full-history -M --date=iso8601 --format=%H -%nauthor %an%nauthor-date %ai%nparents %P%nsummary %B%nfilename ? --follow -n1 --no-merges -- extension-output-#2   cwd='.' 
  Error: fatal: Not a git repository (or any of the parent directories): .git  Failed with exit code: 128
isFileUncommitted('c:/GitHub/Skull132/Aurora.3', 'extension-output-#2')

@skull132 is there any way you could provide logs from both the case where it is working as well as when it isn't? Maybe there is something in those differences that might help shed some light on this.

From the laptop (working and shows git blame properly, same file in the project):

GitLens(v3.4.9) active: c:/Projects/Git/Aurora.3
Git found: 2.12.0.windows.1 @ C:\Program Files\Git\cmd\git.exe
git rev-parse --show-toplevel   cwd='c:/Projects/Git/Aurora.3'
Git version: 2.12.0.windows.1
CodeLens config changed; resetting CodeLens provider
getLogForFile('undefined', 'c:\Projects\Git\Aurora.3\code\modules\projectiles\projectile.dm', undefined, 1, undefined, false)
getLogForFile('undefined', 'c:\Projects\Git\Aurora.3\code\modules\projectiles\projectile.dm', undefined, 1, undefined, false)
getLogForFile('undefined', 'c:\Projects\Git\Aurora.3\code\modules\projectiles\projectile.dm', undefined, 1, undefined, false)
git log --name-status --full-history -M --date=iso8601 --format=%H -%nauthor %an%nauthor-date %ai%nparents %P%nsummary %B%nfilename ? --follow -n1 --no-merges -- projectile.dm   cwd='c:/Projects/Git/Aurora.3/code/modules/projectiles'
isFileUncommitted('c:/Projects/Git/Aurora.3/', 'c:\Projects\Git\Aurora.3\code\modules\projectiles\projectile.dm')
git log --name-status --full-history -M --date=iso8601 --format=%H -%nauthor %an%nauthor-date %ai%nparents %P%nsummary %B%nfilename ? --follow -n1 --no-merges -- projectile.dm   cwd='c:/Projects/Git/Aurora.3/code/modules/projectiles'
isFileUncommitted('c:/Projects/Git/Aurora.3/', 'c:\Projects\Git\Aurora.3\code\modules\projectiles\projectile.dm')
git log --name-status --full-history -M --date=iso8601 --format=%H -%nauthor %an%nauthor-date %ai%nparents %P%nsummary %B%nfilename ? --follow -n1 --no-merges -- projectile.dm   cwd='c:/Projects/Git/Aurora.3/code/modules/projectiles'
getBlameForFile('c:/Projects/Git/Aurora.3/', 'c:\Projects\Git\Aurora.3\code\modules\projectiles\projectile.dm', undefined)
Add blame cache for 'c:/projects/git/aurora.3/code/modules/projectiles/projectile.dm'
git ls-files c:\Projects\Git\Aurora.3\code\modules\projectiles\projectile.dm   cwd='c:/Projects/Git/Aurora.3/'
git ls-files c:\Projects\Git\Aurora.3\code\modules\projectiles\projectile.dm   cwd='c:/Projects/Git/Aurora.3/'
git blame --root --incremental -- code/modules/projectiles/projectile.dm   cwd='c:/Projects/Git/Aurora.3/'
getLogForFile('undefined', 'c:\Projects\Git\Aurora.3\code\modules\projectiles\projectile.dm', undefined, 1, undefined, false)
git log --name-status --full-history -M --date=iso8601 --format=%H -%nauthor %an%nauthor-date %ai%nparents %P%nsummary %B%nfilename ? --follow -n1 --no-merges -- projectile.dm   cwd='c:/Projects/Git/Aurora.3/code/modules/projectiles'
getBlameForFile('c:/Projects/Git/Aurora.3/', 'c:\Projects\Git\Aurora.3\code\modules\projectiles\projectile.dm', undefined)
Add listener registrations for blame annotations
getLogForFile('undefined', 'c:\Projects\Git\Aurora.3\code\modules\projectiles\projectile.dm', undefined, 1, undefined, false)
git log --name-status --full-history -M --date=iso8601 --format=%H -%nauthor %an%nauthor-date %ai%nparents %P%nsummary %B%nfilename ? --follow -n1 --no-merges -- projectile.dm   cwd='c:/Projects/Git/Aurora.3/code/modules/projectiles'
getBlameForFile('c:/Projects/Git/Aurora.3/', 'c:\Projects\Git\Aurora.3\code\modules\projectiles\projectile.dm', undefined)
getLogForFile('undefined', 'extension-output-#2', undefined, 1, undefined, false)
git log --name-status --full-history -M --date=iso8601 --format=%H -%nauthor %an%nauthor-date %ai%nparents %P%nsummary %B%nfilename ? --follow -n1 --no-merges -- extension-output-#2   cwd='.' 
  Error: fatal: Not a git repository (or any of the parent directories): .git  Failed with exit code: 128
isFileUncommitted('c:/Projects/Git/Aurora.3', 'extension-output-#2')
git ls-files extension-output-#2   cwd='c:/Projects/Git/Aurora.3'

@mklemarczyk can you try the new beta here: v3.5.0-beta? You can find installation instructions here: Installing Beta Releases

I'm still very much at a loss to how this is happening, but there have been quite a lot of changes in the latest version and with any luck maybe it will help.

@mklemarczyk I've released 3.5.1 to the marketplace -- please let me know if it resolves your issue. Thanks!

@mklemarczyk I'm going to close this -- please let me know and we can re-open if it is still an issue.

Thank you, I do not find that problem right now.

For what it's worth, I ran into a similar issue, but it turned out to be due to line endings -- locally I was using CRLF on a Windows machine with GitHub Desktop, but the files were actually originally LF.

Once I switched my document from CRLF to LF, the issue went away.

I have the same problem. I switched the file's line endings from CRLF to LF and switched back again and the blames are now correct.

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.

Was this page helpful?
0 / 5 - 0 ratings