Open JordanLongstaff opened 1 year ago
@brettcannon, does this one ring a bell? Thanks!
Nope, this isn't a specific issue that I'm aware of if Python is globally installed and accessible on PATH
(assuming that's how VS Code executes pre-commit hooks).
Same issue when using git in vscode on macOS, it worked when using git in terminal but not in vscode. (It previously worked but the issue happened recently)
I'm currently experiencing the same(ish) issue with a golang repo. I have a pre-commit hook that runs a linter. If I do git commit
from the terminal it works, however trying to commit from vscode gives me the following
> git -c user.useConfigOnly=true commit --quiet --allow-empty-message --file - -S
/home/<SNIP>/dotgit/hooks/pre-commit-format-lint:7: command not found: goimports
/home/<SNIP>/dotgit/hooks/pre-commit-format-lint:23: command not found: golangci-lint
Somehow, when doing a commit via vscode, my shell's PATH
variable isn't read. I've had this issue in the past, but then got fixed when I updated vscode. Now it was reintroduced with the February 1.87
update.
Does this issue occur when all extensions are disabled?: N/A
I have a pre-push hook that runs a Python program:
The Python executable definitely exists on my computer, yet this stops me from being able to push commits using VS Code. Output:
This has to be an issue with VS Code, because I can run the above
git push -u ...
command from the CLI and it works with no problems. Whatever environment VS Code runs git in, it's not one that recognizes the executables in my shell.Either this is a bug, or I need to configure my settings somehow. If it's the latter, please offer whatever help you can.
Steps to Reproduce:
git push -u
and successfully pushes the branch to the remote. The actual behaviour is that it fails to find Python.