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

Some git commands use the terminal and require git to be in the windows PATH variable #1767

Open
SuperflyJon opened this issue Jan 11, 2022 · 3 comments
Labels
bug Something isn't working triage Needs to be looked at

Comments

@SuperflyJon
Copy link

  • GitLens Version:
  • Git Version: 2.34.1.windows.1
  • VSCode Version: Run 1.63.2
  • OS Version: Windows 10

Steps to Reproduce:

  1. Don't have git.exe in the PATH environment variables
  2. An example command that fails is delete branch from the "branches" tab:
    git branch --delete Testing
    git: The term 'git' is not recognized as a name of a cmdlet, function, script file, or executable program.
  3. If I instead do the git: delete branch command then the branch is deleted

So it looks like some of the git lens functionality is implemented by entering git commands in the terminal.

@SuperflyJon SuperflyJon added potential-bug triage Needs to be looked at labels Jan 11, 2022
@maksim-pinguin
Copy link

I experience the same problem using cygwin. My problem is that i have to use cygwin's git binary, but vscode integrated git extension isn't supporting it (or it ignores the integrated terminal profile for some reason).
To make things work i used a hack 1 to change the path styles to windows. For this to work one has set the git.path to this wrapper.

Now since Gitlese is using the integrated terminal. which is set to cygwin/bash. The git.path should be pointing to a different path, namly, cygwins git.

I guess an option to set a custom git path for GitLens would help in this case, since VSCode doesn't seem to care about supporting cygwin. 2

Footnotes

  1. https://gist.github.com/nickbudi/4b489f50086db805ea0f3864aa93a9f8

  2. https://github.com/microsoft/vscode/issues/7998

@eamodio
Copy link
Member

eamodio commented May 4, 2022

Unfortunately, GitLens also doesn't support cygwin/msysgit either. GitLens works with and interacts with the VS Code Git extension, so for things to work properly they both have to support it.

@maksim-pinguin
Copy link

@eamodio well it's an easy fix it's just about path conversion. atm i use a batch srcipt which converts windows paths to unix paths (since git base is useing windows paths). Gitlense on the other hand uses the configured intergreated terminal which is already cygwin (so it supports it). Because gitlense is using the "correct" enviroment the conversion shouldn't be applied.

would it be possible to bring back the gitlense.advanced.git configuration?
this would allow to point to different git binaries for gitlense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Needs to be looked at
Projects
None yet
Development

No branches or pull requests

3 participants