fork of https://github.com/sourcegraph/zoekt
0

Configure Feed

Select the types of activity you want to include in your feed.

feat: GitLab: exclude user repos (#830)

+11 -4
+7 -3
cmd/zoekt-indexserver/config.go
··· 51 51 Active bool 52 52 NoArchived bool 53 53 GerritFetchMetaConfig bool 54 - GerritRepoNameFormat string 54 + GerritRepoNameFormat string 55 + ExcludeUserRepos bool 55 56 } 56 57 57 58 func randomize(entries []ConfigEntry) []ConfigEntry { ··· 243 244 if c.OnlyPublic { 244 245 cmd.Args = append(cmd.Args, "-public") 245 246 } 247 + if c.ExcludeUserRepos { 248 + cmd.Args = append(cmd.Args, "-exclude_user") 249 + } 246 250 if c.CredentialPath != "" { 247 251 cmd.Args = append(cmd.Args, "-token", c.CredentialPath) 248 252 } ··· 261 265 if c.Active { 262 266 cmd.Args = append(cmd.Args, "-active") 263 267 } 264 - if c.GerritFetchMetaConfig { 268 + if c.GerritFetchMetaConfig { 265 269 cmd.Args = append(cmd.Args, "-fetch-meta-config") 266 - } 270 + } 267 271 if c.GerritRepoNameFormat != "" { 268 272 cmd.Args = append(cmd.Args, "-repo-name-format", c.GerritRepoNameFormat) 269 273 }
+4 -1
cmd/zoekt-mirror-gitlab/main.go
··· 46 46 isMember := flag.Bool("membership", false, "only mirror repos this user is a member of ") 47 47 isPublic := flag.Bool("public", false, "only mirror public repos") 48 48 deleteRepos := flag.Bool("delete", false, "delete missing repos") 49 + excludeUserRepos := flag.Bool("exclude_user", false, "exclude user repos") 49 50 namePattern := flag.String("name", "", "only clone repos whose name matches the given regexp.") 50 51 excludePattern := flag.String("exclude", "", "don't mirror repos whose names match this regexp.") 51 52 flag.Parse() ··· 103 104 if project.DefaultBranch == "" { 104 105 continue 105 106 } 107 + if *excludeUserRepos && project.Namespace.Kind == "user" { 108 + continue 109 + } 106 110 107 111 gitlabProjects = append(gitlabProjects, project) 108 112 } ··· 128 132 } 129 133 gitlabProjects = trimmed 130 134 } 131 - 132 135 fetchProjects(destDir, apiToken, gitlabProjects) 133 136 134 137 if *deleteRepos {