-
-
Notifications
You must be signed in to change notification settings - Fork 933
Git().custom_environment(GIT_SSH_COMMAND=git_ssh_cmd) issue #916
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
Comments
Thanks for the detailed information! Something I would do to verify the custom environment information is actually passed by enabling debug output in the logs. Something you could do beforehand though is to use a fully qualified, absolute path to the key file, such as in Please let me know if this worked, or when there are interesting logs to look at. Thanks |
Hey @Byron, I have attached the debug-level log from the command:
From this it appears pretty clear the environment variable wasnt set correctly, considering I can't find 'GIT_PYTHON_TRACE' in the log when I logged 'os.environ'. Thanks, |
Just bumping this thread. @Byron |
Thank, @CaptainJL . Please note that GIT_PYTHON_TRACE=full python main.py main.py import logging
logging.basicConfig(level=logging.INFO)
code_causing_the_issue() This should yield more information. |
I have done a little more probing and added additional logging lines:
For the failing case using with with
But with the success case setting env in clone_from I get:
It is quite clear than clone_from does not get the enviuornment parameters from Git.environment() |
Hey @Byron , so I have actually found a solution to this based on this thread: #306 It turns out that this code below creates 2 different instances of Git() that don't share git instances, which appears to be why it does not work.
As such, you guys created the 'env' parameter to deal with it.
Thanks for you help though @Byron, |
Thanks, @CaptainJL , I should have been more vigilant! The solution you propose, using the As the problem seems solved, I am closing this issue. |
Hey all,
I am having an issue with using the custom_environment parameter.
This is on a Windows 10 machine.
Basically this will not work, returning the error (see under code)
However setting the env variable in the Repo.clone_from command works fine:
Repo.clone_from('[email protected]:<private git>.git', 'python_test_cloning', env={"GIT_SSH_COMMAND": 'ssh -i gpt_key'})
I need to be able to use the ssh key for operation other than cloning, so I need to be able to set up the local environment purely via the python interface. This also fails for reference (when I did sucessfully clone).
with error:
Any ideas of why this is not working and how to fix it?
Remember that this is Windows 10.
Thanks,
CaptainJL
The text was updated successfully, but these errors were encountered: