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: invoke git without terminal, so it cannot ask for password #9341

Closed
kokizzu opened this issue Dec 16, 2014 · 13 comments
Closed

cmd/go: invoke git without terminal, so it cannot ask for password #9341

kokizzu opened this issue Dec 16, 2014 · 13 comments
Milestone

Comments

@kokizzu
Copy link

kokizzu commented Dec 16, 2014

When doing go get ... if the repository has been renamed/deleted by the owner, the go get progress will stuck and asking for Username and Password (especially on github). It would be nice if 404 errors from repository would make go get skip current repository instead of asking username and password.

@kokizzu kokizzu changed the title Do not download when repository is missing on go get ... on git Feature request: skip when repository is missing/gone for go get ... Dec 16, 2014
@kokizzu kokizzu changed the title Feature request: skip when repository is missing/gone for go get ... Feature request: go get should skip when repository is missing/gone Dec 16, 2014
@kokizzu
Copy link
Author

kokizzu commented Dec 16, 2014

Some example output when fetching from missing repository:
image

@adg adg changed the title Feature request: go get should skip when repository is missing/gone cmd/go: get should skip when repository is missing/gone Dec 16, 2014
@adg
Copy link
Contributor

adg commented Dec 16, 2014

This is GitHub misbehaving. They don't want to aid discovery of private repos, so they return auth challenges instead of a 404. Not sure of the best move here.

@ianlancetaylor
Copy link
Contributor

I think we want to permit people to use "go get" with private repositories, where they authenticate themselves at "go get" time, so I don't see how we can do anything to make this better.

@adg
Copy link
Contributor

adg commented Dec 16, 2014

Maybe there's something we can tell git when we invoke it so that it doesn't prompt for interactive auth. But that may defy user expectations also. :-/

@rsc
Copy link
Contributor

rsc commented Apr 10, 2015

The options seem to be:

  1. Don't fix this.

  2. Take away git's connection to the terminal and tell people who want to use private GitHub accounts to put their GitHub credentials somewhere Git can get them non-interactively.

I'm okay with 2. What do other people think?

@rsc rsc added this to the Go1.5Maybe milestone Apr 10, 2015
@kokizzu
Copy link
Author

kokizzu commented Apr 10, 2015

I'm ok with 2, as long it doesn't make the go get ... progress stuck XD

@josharian
Copy link
Contributor

2 seems fine. I know we support older versions of git, but git 2.3.0 introduced the GIT_TERMINAL_PROMPT environment variable to disable prompting for passwords. That'd make this a one-line fix.

@Thomasdezeeuw
Copy link
Contributor

@josharian git on Windows is stil on version 1.9.5 so please support lower git versions in the fix :)

@rsc rsc removed the repo-main label Apr 14, 2015
@rsc rsc changed the title cmd/go: get should skip when repository is missing/gone cmd/go: invoke git without terminal, so it cannot ask for password Jun 29, 2015
@rsc
Copy link
Contributor

rsc commented Jul 14, 2015

Thanks Josh. I will use that suggestion.

@Thomasdezeeuw, I'm sorry, but I have no idea how to fix
the go command's invocation of git for earlier versions.
Git is opening "CONIN$" and "CONOUT$" itself.
It is probably easiest just to suggest that people who
do run into this problem should update to a newer Git.

@gopherbot
Copy link

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

@nightlyone
Copy link
Contributor

Wild guess: setting http://godoc.org/syscall#SysProcAttr.Noctty to true, doesn't help?

@Thomasdezeeuw
Copy link
Contributor

Maybe add info to the docs and a link to this issue, since Git for Windows is still at 1.9.5 (https://git-scm.com/download/win, it autostarts a download)?

@RalphCorderoy
Copy link

This might be helpful. Code that's started using GIT_TERMINAL_PROMPT had other workarounds before, e.g. vim-plug took https://github.com/junegunn/seoul256.vim.git and inserted git::@ to give https://git::@github.com/junegunn/seoul256.vim.git. See https://github.com/junegunn/vim-plug/wiki/faq#whats-the-deal-with-git-in-the-url

@rsc rsc closed this as completed in 8df0bcc Jul 15, 2015
@mikioh mikioh modified the milestones: Go1.5, Go1.5Maybe Jul 16, 2015
@golang golang locked and limited conversation to collaborators Jul 18, 2016
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

10 participants