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

go-get meta tags are incorrect, cause infinite recursion #2577

Closed
rsc opened this issue Sep 22, 2017 · 0 comments · Fixed by #2584
Closed

go-get meta tags are incorrect, cause infinite recursion #2577

rsc opened this issue Sep 22, 2017 · 0 comments · Fixed by #2584
Labels
Milestone

Comments

@rsc
Copy link

rsc commented Sep 22, 2017

Here's a site running gitea: https://zxq.co/ripple/hanayo/routers/oauth?go-get=1. It says:

<meta name="go-import" content="zxq.co/ripple/hanayo/routers/oauth git https://zxq.co/ripple/hanayo.git">

The general form of this tag is

<meta name="go-import" content="IMPORT VCS REPO">

which says that the code at the root directory of VCS REPO is what to use for IMPORT. The tag above is incorrect because it says that https://zxq.co/ripple/hanayo.git is what to use for zxq.co/ripple/hanayo/routers/oauth, but in fact it's what to use for zxq.co/ripple/hanayo.

The correct tag is:

<meta name="go-import" content="zxq.co/ripple/hanayo git https://zxq.co/ripple/hanayo.git">

That is, even though we asked about zxq.co/ripple/hanayo/routers/oauth, the meta tag should tell about the root of the git repo not the current subdirectory (the subdirectory will be deduced from the root).

This happens because routers/repo/http.go includes the subdir in:

func composeGoGetImport(owner, repo, sub string) string {
	return path.Join(setting.Domain, setting.AppSubURL, owner, repo, sub)
}

I believe it would fix this problem to simply drop the ", sub" from the call.

@lafriks lafriks added this to the 1.3.0 milestone Sep 22, 2017
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants