Closed ghost closed 7 years ago
In our real production environment, we have thousands repositories. we need to organize them in 3 or 4 level. Such as
gitexample.com/comap/graph/composite
gitexample.com/comap/compress/xmodzip
They are standalone git repository, and maintained by different department.
AIUI, the repository you are trying to clone is at https://www.gitexample.com/comnap/public_service/short_url.git
? In that case, the meta-tag served at https://www.gitexample.com/comnap/public_service/short_url
should be:
<meta name="go-import" content="www.gitexample.com/comnap/public_service/short_url git https://www.gitexample.com/comnap/public_service/short_url.git">
But it seems to be
<meta name="go-import" content="www.gitexample.com/comnap/public_service git https://www.gitexample.com/comnap/public_service.git">
leading go get to make the extra request for https://www.gitexample.com/comnap/public_service?go-get=1
, which serves the meta-tag
<meta name="go-import" content="www.gitexample.com/comnap/public_service git https://www.gitexample.com/comnap/public_service.git">
so go-get tries to clone that.
Whatever is serving https://www.gitexample.com/ needs to fix the meta-tags it is serving to point to the correct repository. See here for the protocol used. In particular, if you want to make a sub-directory of a repository go-gettable, vcs-prefix needs to be the import-path of the repository root and repo-root should be where to clone the repository from. So, you want to set up the server to serve the meta tag
<meta name="go-import" content="www.gitexample.com/comnap/public_service/short_url git https://www.gitexample.com/comnap/public_service/short_url.git">
on all urls starting with https://gitexample.com/comnap/public_service/short_url
.
Does that help?
I checked the <meta
, There is no <meta name="go-import"
section.
Have you tried including the ?go-get=1
? Because the log claims it found a meta-tag. (I would help verifying, but the domain does not resolve for me, apparently)
Try curl https://www.gitexample.com/comnap/public_service/short_url?go-get=1 | grep go-import
(that's the url the log says it fetches). When I try to use go-get with a path that does not serve a meta-tag, it reports correctly that there is no meta-tag.
I'm going to close this issue because I don't see any fixable bug here. Please comment if you disagree. If you don't understand the meta-tag protocol that @Merovius mentions, please ask a on a forum; see https://golang.org/wiki/Questions. Thanks.
I am having this exact issue. pretty critical for me right now:
(company dns/folder/project name changed)
my meta tag: <meta name="go-import" content="my.gitlab.com/top/sub/project git https://my.gitlab.com/top/sub/project.git" />
but it doesn't like the extra level it seems:
found meta tag get.metaImport{Prefix:"my.gitlab.com/top/sub", VCS:"git", RepoRoot:"https://my.gitlab.com/top/sub.git"} at https://my.gitlab.com/top/sub/project?go-get=1
I realize a real fix would have to wait for the next release, but if I could get a workaround for it, it would be a huge help.
Ignore me. Gitlab issue.
I am try to using
go get
tool to download golang packages.the prefix was
/compnap/public_service
. And theshort_url
was the real project name. But golang try to locatedcomnap/public_service
as git repository. It really not good for us.Why go get can only support one level path?