go get creating strange git messages in bash. Any ideas what causes this ?

261 views
Skip to first unread message

Joe Blue

unread,
Sep 15, 2016, 5:44:12 AM9/15/16
to golang-nuts

hey all,


Does anyone know why "go get" causes the follow weird git messages ? This does NOT happen with al git repos i have found.


a simple example:


````

x-MacBook-Pro:pkg apple$ go get github.com/pkg/sftp

x-MacBook-Pro:pkg apple$ go get -u -v github.com/pkg/sftp

github.com/pkg/sftp (download)

# cd /Users/apple/workspace/go/src/github.com/pkg/sftp; 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/pkg/sftp: exit status 1

x-MacBook-Pro:pkg apple$ 


````



a bigger example.


go get -u -v github.com/spf13/hugo


x-MacBook-Pro:godev apple$ go version

go version go1.7.1 darwin/amd64


x-MacBook-Pro:go apple$ go env
GOARCH="amd64"
GOBIN="/Users/apple/workspace/go/bin"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/apple/workspace/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/wp/ff6sz9qs6g71jnm12nj2kbyw0000gp/T/go-build436806324=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"




go get -u -v github.com/spf13/hugo
github.com/spf13/hugo (download)
github.com/fsnotify/fsnotify (download)
Fetching https://golang.org/x/sys/unix?go-get=1
Parsing meta tags from https://golang.org/x/sys/unix?go-get=1 (status code 200)
get "golang.org/x/sys/unix": found meta tag main.metaImport{Prefix:"golang.org/x/sys", VCS:"git", RepoRoot:"https://go.googlesource.com/sys"} at https://golang.org/x/sys/unix?go-get=1
get "golang.org/x/sys/unix": verifying non-authoritative meta tag
Fetching https://golang.org/x/sys?go-get=1
Parsing meta tags from https://golang.org/x/sys?go-get=1 (status code 200)
golang.org/x/sys (download)
github.com/kardianos/osext (download)
github.com/spf13/afero (download)
github.com/pkg/sftp (download)
# cd /Users/apple/workspace/go/src/github.com/pkg/sftp; git pull --ff-only
From https://github.com/pkg/sftp
   57fcf4a..8197a2e  master     -> origin/master
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/pkg/sftp: exit status 1
Fetching https://golang.org/x/text/transform?go-get=1
Parsing meta tags from https://golang.org/x/text/transform?go-get=1 (status code 200)
get "golang.org/x/text/transform": found meta tag main.metaImport{Prefix:"golang.org/x/text", VCS:"git", RepoRoot:"https://go.googlesource.com/text"} at https://golang.org/x/text/transform?go-get=1
get "golang.org/x/text/transform": verifying non-authoritative meta tag
Fetching https://golang.org/x/text?go-get=1
Parsing meta tags from https://golang.org/x/text?go-get=1 (status code 200)
golang.org/x/text (download)
Fetching https://golang.org/x/text/unicode/norm?go-get=1
Parsing meta tags from https://golang.org/x/text/unicode/norm?go-get=1 (status code 200)
get "golang.org/x/text/unicode/norm": found meta tag main.metaImport{Prefix:"golang.org/x/text", VCS:"git", RepoRoot:"https://go.googlesource.com/text"} at https://golang.org/x/text/unicode/norm?go-get=1
get "golang.org/x/text/unicode/norm": verifying non-authoritative meta tag
github.com/spf13/cast (download)
github.com/spf13/jwalterweatherman (download)
github.com/spf13/cobra (download)
github.com/spf13/pflag (download)
github.com/cpuguy83/go-md2man (download)
github.com/russross/blackfriday (download)
github.com/shurcooL/sanitized_anchor_name (download)
github.com/spf13/fsync (download)
github.com/PuerkitoBio/purell (download)
github.com/PuerkitoBio/urlesc (download)
Fetching https://golang.org/x/net/idna?go-get=1
Parsing meta tags from https://golang.org/x/net/idna?go-get=1 (status code 200)
get "golang.org/x/net/idna": found meta tag main.metaImport{Prefix:"golang.org/x/net", VCS:"git", RepoRoot:"https://go.googlesource.com/net"} at https://golang.org/x/net/idna?go-get=1
get "golang.org/x/net/idna": verifying non-authoritative meta tag
Fetching https://golang.org/x/net?go-get=1
Parsing meta tags from https://golang.org/x/net?go-get=1 (status code 200)
golang.org/x/net (download)
Fetching https://golang.org/x/text/secure/precis?go-get=1
Parsing meta tags from https://golang.org/x/text/secure/precis?go-get=1 (status code 200)
get "golang.org/x/text/secure/precis": found meta tag main.metaImport{Prefix:"golang.org/x/text", VCS:"git", RepoRoot:"https://go.googlesource.com/text"} at https://golang.org/x/text/secure/precis?go-get=1
get "golang.org/x/text/secure/precis": verifying non-authoritative meta tag
Fetching https://golang.org/x/text/cases?go-get=1
Parsing meta tags from https://golang.org/x/text/cases?go-get=1 (status code 200)
get "golang.org/x/text/cases": found meta tag main.metaImport{Prefix:"golang.org/x/text", VCS:"git", RepoRoot:"https://go.googlesource.com/text"} at https://golang.org/x/text/cases?go-get=1
get "golang.org/x/text/cases": verifying non-authoritative meta tag
Fetching https://golang.org/x/text/language?go-get=1
Parsing meta tags from https://golang.org/x/text/language?go-get=1 (status code 200)
get "golang.org/x/text/language": found meta tag main.metaImport{Prefix:"golang.org/x/text", VCS:"git", RepoRoot:"https://go.googlesource.com/text"} at https://golang.org/x/text/language?go-get=1
get "golang.org/x/text/language": verifying non-authoritative meta tag
Fetching https://golang.org/x/text/internal/tag?go-get=1
Parsing meta tags from https://golang.org/x/text/internal/tag?go-get=1 (status code 200)
get "golang.org/x/text/internal/tag": found meta tag main.metaImport{Prefix:"golang.org/x/text", VCS:"git", RepoRoot:"https://go.googlesource.com/text"} at https://golang.org/x/text/internal/tag?go-get=1
get "golang.org/x/text/internal/tag": verifying non-authoritative meta tag
Fetching https://golang.org/x/text/runes?go-get=1
Parsing meta tags from https://golang.org/x/text/runes?go-get=1 (status code 200)
get "golang.org/x/text/runes": found meta tag main.metaImport{Prefix:"golang.org/x/text", VCS:"git", RepoRoot:"https://go.googlesource.com/text"} at https://golang.org/x/text/runes?go-get=1
get "golang.org/x/text/runes": verifying non-authoritative meta tag
Fetching https://golang.org/x/text/secure/bidirule?go-get=1
Parsing meta tags from https://golang.org/x/text/secure/bidirule?go-get=1 (status code 200)
get "golang.org/x/text/secure/bidirule": found meta tag main.metaImport{Prefix:"golang.org/x/text", VCS:"git", RepoRoot:"https://go.googlesource.com/text"} at https://golang.org/x/text/secure/bidirule?go-get=1
get "golang.org/x/text/secure/bidirule": verifying non-authoritative meta tag
Fetching https://golang.org/x/text/unicode/bidi?go-get=1
Parsing meta tags from https://golang.org/x/text/unicode/bidi?go-get=1 (status code 200)
get "golang.org/x/text/unicode/bidi": found meta tag main.metaImport{Prefix:"golang.org/x/text", VCS:"git", RepoRoot:"https://go.googlesource.com/text"} at https://golang.org/x/text/unicode/bidi?go-get=1
get "golang.org/x/text/unicode/bidi": verifying non-authoritative meta tag
Fetching https://golang.org/x/text/width?go-get=1
Parsing meta tags from https://golang.org/x/text/width?go-get=1 (status code 200)
get "golang.org/x/text/width": found meta tag main.metaImport{Prefix:"golang.org/x/text", VCS:"git", RepoRoot:"https://go.googlesource.com/text"} at https://golang.org/x/text/width?go-get=1
get "golang.org/x/text/width": verifying non-authoritative meta tag
github.com/kyokomi/emoji (download)
github.com/miekg/mmark (download)
github.com/BurntSushi/toml (download)
# cd /Users/apple/workspace/go/src/github.com/BurntSushi/toml; 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/BurntSushi/toml: exit status 1
github.com/mitchellh/mapstructure (download)
github.com/spf13/viper (download)
github.com/hashicorp/hcl (download)
github.com/magiconair/properties (download)
github.com/pelletier/go-toml (download)
github.com/pelletier/go-buffruneio (download)
Fetching https://gopkg.in/yaml.v2?go-get=1
Parsing meta tags from https://gopkg.in/yaml.v2?go-get=1 (status code 200)
get "gopkg.in/yaml.v2": found meta tag main.metaImport{Prefix:"gopkg.in/yaml.v2", VCS:"git", RepoRoot:"https://gopkg.in/yaml.v2"} at https://gopkg.in/yaml.v2?go-get=1
gopkg.in/yaml.v2 (download)
github.com/bep/inflect (download)
github.com/dchest/cssmin (download)
github.com/nicksnyder/go-i18n (download)
github.com/eknkc/amber (download)
github.com/yosssi/ace (download)
github.com/spf13/nitro (download)
github.com/gorilla/websocket (download)
# cd /Users/apple/workspace/go/src/github.com/gorilla/websocket; git pull --ff-only
From https://github.com/gorilla/websocket
   a69d25b..2d1e454  master     -> origin/master
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/gorilla/websocket: exit status 1
x-MacBook-Pro:go apple$ hugo
-bash: hugo: command not found

James Bardin

unread,
Sep 15, 2016, 7:24:49 AM9/15/16
to golang-nuts
You have a few repos that aren't on a branch, so git can't pull and fast forward. You can checkout master in those repos, or delete them altogether and the next `go get` will fetch the current master branch.

Joe Blue

unread,
Sep 15, 2016, 5:53:50 PM9/15/16
to James Bardin, golang-nuts
thanks James

You lost me here.
go get always pulls from master though ?




On Thu, Sep 15, 2016 at 1:25 PM James Bardin <j.ba...@gmail.com> wrote:
You have a few repos that aren't on a branch, so git can't pull and fast forward. You can checkout master in those repos, or delete them altogether and the next `go get` will fetch the current master branch.

--
You received this message because you are subscribed to a topic in the Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-nuts/JIhHPOuiHTQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

James Bardin

unread,
Sep 15, 2016, 8:15:02 PM9/15/16
to Joe Blue, golang-nuts
On Thu, Sep 15, 2016 at 5:53 PM, Joe Blue <joeb...@gmail.com> wrote:
thanks James

You lost me here.

Where's here? O can try to provide more detail if you let me know what you're not following. If you go into each repo that's not working and checkout master, "go get -u" will work again. 
 
go get always pulls from master though ?


Yes, "go get" clones the master branch if there is no local copy, and runs `git pull --ff-only` if the repo exists and the -u flag is provided (as you see in the log).
 

Joe Blue

unread,
Sep 16, 2016, 3:49:10 AM9/16/16
to James Bardin, golang-nuts
thanks again.

your explanation about go get helped. 
SO i looked at the offending repo. Its not my repo, just someones on github


What i cant work out is WHY this repo outputs weird git messages, and others dont.
Its not blocking me working, but i am just wanting to know. I am OC (Obsessive Compulsive) i guess :)

Maybe i shoudl just move on, but if you or others know why that repo does what it does would be great to understand.


````
x-MacBook-Pro:pkg apple$ rm -rf sftp/

x-MacBook-Pro:pkg apple$ go get github.com/pkg/sftp

x-MacBook-Pro:pkg apple$ rm -rf sftp/

x-MacBook-Pro:pkg apple$ go get -u -v github.com/pkg/sftp

github.com/pkg/sftp (download)

github.com/kr/fs (download)

# cd /Users/apple/workspace/go/src/github.com/kr/fs; 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/kr/fs: exit status 1

github.com/pkg/errors (download)

Fetching https://golang.org/x/crypto/ssh?go-get=1

Parsing meta tags from https://golang.org/x/crypto/ssh?go-get=1 (status code 200)

get "golang.org/x/crypto/ssh": found meta tag main.metaImport{Prefix:"golang.org/x/crypto", VCS:"git", RepoRoot:"https://go.googlesource.com/crypto"} at https://golang.org/x/crypto/ssh?go-get=1

get "golang.org/x/crypto/ssh": verifying non-authoritative meta tag

Fetching https://golang.org/x/crypto?go-get=1

Parsing meta tags from https://golang.org/x/crypto?go-get=1 (status code 200)

golang.org/x/crypto (download)

Fetching https://golang.org/x/crypto/curve25519?go-get=1

Parsing meta tags from https://golang.org/x/crypto/curve25519?go-get=1 (status code 200)

get "golang.org/x/crypto/curve25519": found meta tag main.metaImport{Prefix:"golang.org/x/crypto", VCS:"git", RepoRoot:"https://go.googlesource.com/crypto"} at https://golang.org/x/crypto/curve25519?go-get=1

get "golang.org/x/crypto/curve25519": verifying non-authoritative meta tag

Fetching https://golang.org/x/crypto/ed25519?go-get=1

Parsing meta tags from https://golang.org/x/crypto/ed25519?go-get=1 (status code 200)

get "golang.org/x/crypto/ed25519": found meta tag main.metaImport{Prefix:"golang.org/x/crypto", VCS:"git", RepoRoot:"https://go.googlesource.com/crypto"} at https://golang.org/x/crypto/ed25519?go-get=1

get "golang.org/x/crypto/ed25519": verifying non-authoritative meta tag

Fetching https://golang.org/x/crypto/ed25519/internal/edwards25519?go-get=1

Parsing meta tags from https://golang.org/x/crypto/ed25519/internal/edwards25519?go-get=1 (status code 200)

get "golang.org/x/crypto/ed25519/internal/edwards25519": found meta tag main.metaImport{Prefix:"golang.org/x/crypto", VCS:"git", RepoRoot:"https://go.googlesource.com/crypto"} at https://golang.org/x/crypto/ed25519/internal/edwards25519?go-get=1

get "golang.org/x/crypto/ed25519/internal/edwards25519": verifying non-authoritative meta tag

x-MacBook-Pro:pkg apple$ 

````



cheers

Joe



Wojciech S. Czarnecki

unread,
Sep 16, 2016, 5:27:37 AM9/16/16
to golan...@googlegroups.com
Dnia 2016-09-16, o godz. 07:48:32
Joe Blue <joeb...@gmail.com> napisał(a):

> thanks again.
>
> your explanation about go get helped.
> SO i looked at the offending repo. Its not my repo, just someones on github
>
> github.com/pkg/sftp
Your *local* copy is in detached head state. I.e. you manually or some
vendoring script checked out something else than master at head. To fix
it you need to checkout master as said.

> What i cant work out is WHY this repo outputs weird git messages, and
> others dont.
Others (your local copies) were not touched.

> Its not blocking me working, but i am just wanting to know. I am OC
> (Obsessive Compulsive) i guess :)

Get a book on git, e.g. "Git Essentials" ISBN 978-1-78528-790-9 or some
other out of 20+ written.

> Maybe i shoudl just move on, but if you or others know why that repo does
> what it does would be great to understand.

You will - just read a decent book bedtime.

> x-MacBook-Pro:pkg apple$ rm -rf sftp/
This is NOT the offending repo, github.com/kr/fs is.

> # cd /Users/apple/workspace/go/src/github.com/kr/fs
Do 'git checkout master' here
then 'git pull --ff-only'

> Joe


--
Wojciech S. Czarnecki
^oo^ OHIR-RIPE

Joe Blue

unread,
Sep 16, 2016, 6:41:50 AM9/16/16
to Wojciech S. Czarnecki, golan...@googlegroups.com
thanks,

it was a dependency of the repo. Makes sense.

thanks.

consider closed :)

Reply all
Reply to author
Forward
0 new messages