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

Set uploadpack.allowFilter etc on gitea serv to enable partial clones with SSH #20879

Conversation

zeripath
Copy link
Contributor

When setting.Git.DisablePartialClone is set to false then the
web server will add filter support to web http. The ssh serv
wrapper is missing this code and therefore we need to add it.

Fix #20400

Signed-off-by: Andrew Thornton art27@cantab.net

… with ssh

When setting.Git.DisablePartialClone is set to false then the
web server will add filter support to web http. The ssh serv
wrapper is missing this code and therefore we need to add it.

Fix go-gitea#20400

Signed-off-by: Andrew Thornton <art27@cantab.net>
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Aug 20, 2022
@@ -326,6 +326,11 @@ func runServ(c *cli.Context) error {
// it could be re-considered whether to use the same git.CommonGitCmdEnvs() as "git" command later.
gitcmd.Env = append(gitcmd.Env, git.CommonCmdServEnvs()...)

// By default partial clones are disabled, enable them from git v2.22
if !setting.Git.DisablePartialClone && git.CheckGitVersionAtLeast("2.22") == nil {
gitcmd.Env = append(gitcmd.Env, "-c", "uploadpack.allowfilter=true", "-c", "uploadpack.allowAnySHA1InWant=true")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think these works if you append them to the environment variables. You need to pass these as arguments.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hah! What was I thinking! Of course this should be arguments!!

@zeripath zeripath added the pr/wip This PR is not ready for review label Aug 21, 2022
@zeripath
Copy link
Contributor Author

I'm gonna close this as we need to decide what we're going to do here - but we should do something about this.

@zeripath zeripath closed this Aug 21, 2022
@zeripath zeripath added type/bug backport/v1.17 and removed type/bug lgtm/need 1 This PR needs approval from one additional maintainer to be merged. pr/wip This PR is not ready for review backport/v1.17 labels Aug 21, 2022
@Gusted Gusted removed this from the 1.18.0 milestone Aug 21, 2022
@zeripath zeripath added this to the 1.18.0 milestone Aug 21, 2022
@zeripath
Copy link
Contributor Author

Ready again

@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Aug 21, 2022
@zeripath zeripath removed type/bug lgtm/need 1 This PR needs approval from one additional maintainer to be merged. backport/v1.17 labels Aug 21, 2022
@zeripath zeripath removed this from the 1.18.0 milestone Aug 21, 2022
@zeripath
Copy link
Contributor Author

but I can't reopen the request for some reason so see #20902

@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Aug 21, 2022
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/need 1 This PR needs approval from one additional maintainer to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

partial clone not working with filter
4 participants