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

cmd/go: do not replace existing $GIT_TERMINAL_PROMPT #12706

Closed
ScottMansfield opened this issue Sep 21, 2015 · 4 comments
Closed

cmd/go: do not replace existing $GIT_TERMINAL_PROMPT #12706

ScottMansfield opened this issue Sep 21, 2015 · 4 comments
Milestone

Comments

@ScottMansfield
Copy link

The go get command was changed in 1.5 to disable git prompts universally (see issue #9341). This change reduced choice for how people want to work with the go get command (and was slightly aggrivating to track down). I'd suggest reverting the change and letting people set their own (git-standard) environment variable to disable the prompts themselves. It shouldn't be go's purview to allow or disallow prompts.

Even if the previous change isn't reversed, it should be easy to check for a GO_GET_GIT_COMMAND_PROMPT env var or something along those lines to make it easier to configure. Currently, I have to make sure git knows my username and password for every place I want to download from, where it would be easier to just set an env var and say I want those interactive prompts back.

@adg adg changed the title Allow interactive git prompts cmd/go: Allow interactive git prompts Sep 21, 2015
@ianlancetaylor ianlancetaylor added this to the Go1.6 milestone Sep 22, 2015
@rakyll
Copy link
Contributor

rakyll commented Sep 22, 2015

You can cache your password for a limited time in the cache by git config --global credential.helper 'cache --timeout=x'. Then, use the keychain credential cacher to set your username and password and go get.

@rsc
Copy link
Contributor

rsc commented Oct 16, 2015

I'm sorry this disrupted your workflow, but as discussed in #9341, otherwise we get spurious username/password prompts from Git for non-existent GitHub repositories. This isn't about personal preference on password prompts; it's about ensuring correct operation in that case, so it is certainly the go command's purview.

I'm not particularly inclined to add yet another environment variable.

Perhaps we could change the go command to leave any existing $GIT_TERMINAL_PROMPT in place, so that people who really want the broken behavior can set GIT_TERMINAL_PROMPT=1.

@rsc rsc changed the title cmd/go: Allow interactive git prompts cmd/go: do not replace existing $GIT_TERMINAL_PROMPT Oct 16, 2015
@ScottMansfield
Copy link
Author

Ah, that makes sense. I didn't read #9341 closely enough. I agree adding another environment variable would add unnecessary complication.

Being able to say GIT_TERMINAL_PROMPT=1 go get ... would be great, so your solution sounds good to me.

@rakyll rakyll self-assigned this Oct 19, 2015
@gopherbot
Copy link

CL https://golang.org/cl/16091 mentions this issue.

@rakyll rakyll closed this as completed in 4dc49d2 Oct 19, 2015
@golang golang locked and limited conversation to collaborators Oct 24, 2016
@rsc rsc unassigned rakyll Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants