golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
123.98k stars 17.67k forks source link

cmd/go: disable go get chatter about git config #10922

Closed rsc closed 9 years ago

rsc commented 9 years ago

This looks like bad debugging prints:

g% go get -u rsc.io/benchstat
# cd /Users/rsc/g/src/rsc.io/benchstat; git config remote.origin.url
# cd /Users/rsc/g/src/rsc.io/benchstat; git config remote.origin.url
g%
dsymonds commented 9 years ago

I can't reproduce this at tip. Near as I can tell, those lines come from src/cmd/go/vcs.go:309, but are only printed when the command fails. That'll happen if, for instance, you don't have a remote called "origin" in an existing repository.

c9s commented 9 years ago

Can't reproduce too. at commit 80864cf1f7804e23be215245a70d70efd1116bb4

c9s commented 9 years ago

I can now reproduce it, I dropped the origin remote from rsc.io/benchstat and re-run command again, it shows the same message.

go get -u rsc.io/benchstat
# cd /Users/c9s/src/rsc.io/benchstat; git config remote.origin.url
# cd /Users/c9s/src/rsc.io/benchstat; git pull --ff-only
fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.
c9s commented 9 years ago

The error message is improved in this CL: https://go-review.googlesource.com/10475

gopherbot commented 9 years ago

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

rsc commented 9 years ago

Fixes syntax was wrong.