gitHistoryVSCode: Error when 'View file contents'

Thanks for your excellent work.

There is a problem when I try to view one of the history file contents. It worked before. I am not sure when this problem started because I don’t use this command for a long time. My laptop and desktop have the same problem. The output is

git rev-parse --show-toplevel (completed in 0.001s) {"stack":"Error: spawn C:/Program Files/Git/bin/git ENOENT\n\tat exports._errnoException (util.js:1050:11)\n\tat Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)\n\tat onErrorNT (internal/child_process.js:367:16)\n\tat _combinedTickCallback (internal/process/next_tick.js:80:11)\n\tat process._tickCallback (internal/process/next_tick.js:104:9)","message":"spawn C:/Program Files/Git/bin/git ENOENT","code":"ENOENT","errno":"ENOENT","syscall":"spawn C:/Program Files/Git/bin/git","path":"C:/Program Files/Git/bin/git","spawnargs":["rev-parse","--show-toplevel"]} git rev-parse --show-toplevel (completed in 0.002s)

image

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 17
  • Comments: 23 (2 by maintainers)

Most upvoted comments

Having the same issue, “View file contents” does nothing

Me too:

  • OS: Windows 10
  • Git: 2.18.0.windows.1
  • VSCode: 1.25.1
  • Git History: 0.4.2

For some reason, when trying to open history of any file, it appends the drive letter C:/ to the correct path (I have my project on drive D:) so it ends being C:/d:/path/to/file.ext

@Mrneet I’ve made a fix package. You can use it until @DonJayamanne merge my pr.

There are other issues.

Clicking “Compare against workspace file” get error image

Clicking “Compare against previous version” and nothing happens.

ver. 5.8.2, Windows 10

I am getting the same error. It seems that when the extension submit the command, it builds wrong the path to the file . In the git log I see the following:

git log --pretty=oneline b0859fbc3bedf5b68bf21af1f071ac614b053206^1 -n 1 – …....\c:\tomer\projects\CellXM\server\controllers\cm\auditController.js (completed in 0.096s) fatal: …....\c:\tomer\projects\CellXM\server\controllers\cm\auditController.js: ‘…....\c:\tomer\projects\CellXM\server\controllers\cm\auditController.js’ is outside repository

git show b0859fbc3bedf5b68bf21af1f071ac614b053206:…/…/…/c:/tomer/projects/CellXM/server/controllers/cm/auditController.js (completed in 0.099s) fatal: ‘…/…/…/c:/tomer/projects/CellXM/server/controllers/cm/auditController.js’ is outside repository

When I am using this plugin in VS Code on a mac it works fine - so I believe it’s something to do with how Windows files are addressed…