Skip to content

cmd/go: get doesn't work with repositories from git.apache.org #10797

Closed
@kostya-sh

Description

@kostya-sh

Apache maintains read-only Git mirrors at http://git.apache.org/ (See http://www.apache.org/dev/git.html for more details). Only HTTP and Git protocols are supported (i.e. no HTTPS at the moment)

go get fails to clone such repositories. E.g.:

> go get git.apache.org/thrift.git/lib/go/thrift
fatal: repository 'http://git.apache.org/thrift/' not found

This happens because go get extracts incorrect remote repository URL from import path.

E.g. for git.apache.org/thrift.git/lib/go/thrift import path the remote URL used by go is http://git.apache.org/thrift/ while the correct remote URL should be http://git.apache.org/thrift.git (compare git ls-remote http://git.apache.org/thrift.git vs git ls-remote http://git.apache.org/thrift/)

To fix this a special case needs to be added for git.apache.org in cmd/go/vcs.go similar to (github, launchpad, etc).

I am happy to contribute and test a patch if adding support for another special Git repo to go get seems to be reasonable to Go Team.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions