GithubHelp home page GithubHelp logo

Comments (15)

dmitshur avatar dmitshur commented on July 18, 2024

Thanks for reporting this. I'll be able to look more into it after Friday.

Off the top of my head (no pun intended), I've seen similar things in the past, and I think this might be related to gopkg.in service doing a hacky edit on the git information it serves, which does not quite match what a normal repository would serve. The solution might be to try to submit a PR to gopkg.in to make it serve git information that's more in line with what one would expect, or update Go Package Store to be able to deal with it.

Two questions:

  1. Are you using the latest master version of Go Package Store and all of its dependencies? I.e., did you do go get -u github.com/shurcooL/Go-Package-Store/cmd/Go-Package-Store recently?
  2. What does git --version print?

from go-package-store.

dmitshur avatar dmitshur commented on July 18, 2024

Ok, I can reproduce too:

$ go get -u gopkg.in/sourcemap.v1
$ Go-Package-Store 
Using all Go packages in GOPATH.
Go Package Store server is running at http://localhost:7043/updates.
skipping "gopkg.in/sourcemap.v1" because of remote error:
	no HEAD branch

It also affects gostatus in a similar way:

$ gostatus -v gopkg.in/sourcemap.v1
2017/03/16 10:33:09 gopkg.in/sourcemap.v1: no HEAD branch
  ?  gopkg.in/sourcemap.v1/...
	? Unreachable remote (check your connection)

from go-package-store.

mvdan avatar mvdan commented on July 18, 2024

Are you using the latest master version of Go Package Store and all of its dependencies?

Yes.

What does git --version print?

git version 2.12.0

For completeness, this is go version devel +d5dc490519 Thu Mar 16 02:44:16 2017 +0000 linux/amd64.

from go-package-store.

mvdan avatar mvdan commented on July 18, 2024

I also thought gopkg.in could be to blame. I've had issues with it in the past, especially with repos disappearing and it returning non-git replies to requests.

from go-package-store.

dmitshur avatar dmitshur commented on July 18, 2024

The underlying issue is in github.com/shurcooL/vcsstate package, and it can be reproduced with:

$ goexec -quiet '
    rv, err := vcsstate.NewRemoteVCS(vcs.ByCmd("git"))
    if err != nil {
        log.Fatalln(err)
    }
    branch, revision, err := rv.RemoteBranchAndRevision("https://gopkg.in/sourcemap.v1")
    fmt.Printf("branch = %q\nrevision = %q\nerr = %v\n", branch, revision, err)'
branch = ""
revision = "6e83acea0053641eff084973fee085f0c193c61a"
err = HEAD branch not found in ls-remote output

Basically, it's not able to deduct what is the "default branch" from the remote.

Given that go get -u gopkg.in/sourcemap.v1 seems to work without errors, it's more likely this is a bug in vcsstate rather than incorrect output from gopkg.in. But it's also possible go get behavior is not strict about following specs.

I'll look more into it after Friday.

from go-package-store.

mvdan avatar mvdan commented on July 18, 2024

No hurry, just wanted to bring it up so I wouldn't forget about it :) Thanks for looking into it!

from go-package-store.

dmitshur avatar dmitshur commented on July 18, 2024

I've created niemeyer/gopkg#54 which I believe is the root issue that needs to be resolved. Once it is, everything here should work.

I could try to add some hacky workarounds for gopkg.in import paths in the meantime, but I'd rather not do that.

Below are some notes for my reference.

curl -A 'git/2:2.1.1+github-607-gfba4028' 'https://github.com/go-sourcemap/sourcemap/info/refs?service=git-upload-pack'
curl -A 'git/2:2.1.1+github-607-gfba4028' 'https://gopkg.in/sourcemap.v1/info/refs?service=git-upload-pack'
git ls-remote --symref 'https://github.com/go-sourcemap/sourcemap' HEAD 'refs/heads/*'
git ls-remote --symref 'https://gopkg.in/sourcemap.v1' HEAD 'refs/heads/*'

from go-package-store.

mvdan avatar mvdan commented on July 18, 2024

Now it also throws local revision is empty sometimes:

skipping "gopkg.in/sourcemap.v1" because of remote error:
        no HEAD branch
skipping "gopkg.in/src-d/go-git.v4" because:
        local revision is empty

from go-package-store.

dmitshur avatar dmitshur commented on July 18, 2024

That's unexpected. Was it a one-off thing, or does it happen reproducibly?

What does gostatus -v 'gopkg.in/src-d/go-git.v4' print for you, if you have the latest version of gostatus (and its dependencies)?

from go-package-store.

mvdan avatar mvdan commented on July 18, 2024

Apologies for the late reply.

Was it a one-off thing, or does it happen reproducibly?

Ran again today, the same output.

What does gostatus -v 'gopkg.in/src-d/go-git.v4' print for you

 $ gostatus -v 'gopkg.in/src-d/go-git.v4'
b #  gopkg.in/src-d/go-git.v4/...
        b Non-default branch checked out
        # Remote URL doesn't match repo URL inferred from import path:
                  (actual) [email protected]:mvdan/go-git.git
                (expected) [email protected]:src-d/go-git.v4

Note that the branch is v4...upstream/v4 as it should be. And the remotes are upstream and origin as explained above.

Edit: by above I meant #73.

from go-package-store.

mvdan avatar mvdan commented on July 18, 2024

Also, running the latest version of your programs and their deps (unless Go-Package-Store isn't working properly, ha!)

from go-package-store.

dmitshur avatar dmitshur commented on July 18, 2024

Thanks.

I investigated the gopkg.in/src-d/go-git.v4 issue, and figured out what's going on. See #74.

from go-package-store.

bits01 avatar bits01 commented on July 18, 2024

Also seeing the same or similar issue:

% Go-Package-Store -govendor vendor/vendor.json
Reading the list of Go packages from vendor.json file: vendor/vendor.json
Go Package Store server is running at http://localhost:7043/updates.
skipping "cloud.google.com/go" because of remote error:
	HEAD branch not found in ls-remote output
skipping "google.golang.org/api" because of remote error:
	HEAD branch not found in ls-remote output

from go-package-store.

dmitshur avatar dmitshur commented on July 18, 2024

@bits01, this issue is about gopkg.in repos only (I've renamed it to better reflect that). What you're seeing is not gopkg.in, so it might be a real issue. Can you open a new issue and provide more information on how I can reproduce it?

from go-package-store.

bits01 avatar bits01 commented on July 18, 2024

@shurcooL issue #79 thank you for looking into it.

from go-package-store.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.