Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upremote.push - how to know username/password is required and how to provide? #440
Comments
Which version of GitPython are you using ? There has been a bug that could cause it to omit certain messages to stderr in the past. Besides, as a general note, GitPython will do auth only without any user input. Usually this works by supplying a working ssh configuration, or by configuring GIT_SSH_COMMAND via the custom environment functionality of |
I'm creating a GUI that I hope can make it easier to use GIT. I think the solution has to be to set GIT_ASKPASS to run a process that the parent process Is this something you would add and support in GitPython? |
Ah, interesting ! I think you should be able to set custom environment variables per call or for all calls on each repository's git instance. That way you can provide your own program to bring up some GUI to collect the login data for you as needed. Regarding this issue: I wouldn't know what to do about it ... can you clarify ? |
I think that you should consider handling the credentials side of GIT in the GitPython code. For this it looks like you need a executable that you point GIT_ASKPASS at. That program will read its stdin and write that into GitPythons pipe. GitPython calls a Is that the clarification you wanted? |
It seems this issue turned from a question and possibly a description of an issue (i.e. missing error description from git.push) into a specific feature request. As to me GitPython is in maintenance mode and will only receive bugfixes or merges of suitable PRs, I flagged this issue as Maybe with you possibly implementing GIT_ASKPASS already, you might eventually see how the created code could integrate with GitPython to make it more useful to everyone. |
I'll experiment with solution in git-workbench and when I have something useful I will create a PR for you. |
It seems that I GitPython does not tell the caller that username/password are required by git.
Did I miss something in the API to do this?
Why does the call to remote.push fail with an error detailing the auth failure? I get a exit code 128.
I had to patch the source to print the git stderr to see why this failure happened.