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

proposal: cmd/go: allow 'go get' to checkout a specific tag on a git clone #23244

Closed
jean-christophe-manciot opened this issue Dec 26, 2017 · 1 comment

Comments

@jean-christophe-manciot
Copy link

jean-christophe-manciot commented Dec 26, 2017

What version of Go are you using (go version)?

# go version
go version go1.9.2 linux/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

# go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/actionmystique/src/GO-Packages"
GORACE=""
GOROOT="/usr/lib/go"
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build413906626=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"

What did you do?

# go get github.com/ncw/rclone
...
# cd github.com/ncw/rclone
# git checkout v1.39
Note: checking out 'v1.39'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at f34a9116... Version v1.39

# go get -u -v github.com/ncw/rclone
github.com/ncw/rclone (download)
cd /home/actionmystique/src/GO-Packages/src/github.com/ncw/rclone; git pull --ff-only
You are not currently on a branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

package github.com/ncw/rclone: exit status 1

What did you expect to see?

The ability to build a git package on a specific tag

What did you see instead?

an error

My proposal

# go get <git_package> <git_tag>

OR

# git checkout <git_tag>
# go get -u <git_package>
@bradfitz bradfitz changed the title [proposal] allow 'go get' to checkout a specific tag on a git clone proposal: allow 'go get' to checkout a specific tag on a git clone Dec 26, 2017
@gopherbot gopherbot added this to the Proposal milestone Dec 26, 2017
@bradfitz
Copy link
Contributor

This is a dup of #21933, #5779, #5633, #13700, etc.

@rsc is working on package management at the moment. He has plans for resolving this in a different way.

I'm going to close this because #13700 is still open. I'll also create the PackageManagement label for all these.

@mikioh mikioh changed the title proposal: allow 'go get' to checkout a specific tag on a git clone proposal: cmd/go: allow 'go get' to checkout a specific tag on a git clone Dec 27, 2017
@golang golang locked and limited conversation to collaborators Dec 27, 2018
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

3 participants