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

Configure Feed

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

zoekt-mirror-gitlab: add last_activity_after flag (#845)

author
po3rin
committer
GitHub
date (Oct 21, 2024, 9:43 AM +0200) commit d80d701f parent da3626ec
+10
+10
cmd/zoekt-mirror-gitlab/main.go
··· 32 32 "path/filepath" 33 33 "strconv" 34 34 "strings" 35 + "time" 35 36 36 37 "github.com/sourcegraph/zoekt/gitindex" 37 38 gitlab "github.com/xanzy/go-gitlab" ··· 49 50 excludeUserRepos := flag.Bool("exclude_user", false, "exclude user repos") 50 51 namePattern := flag.String("name", "", "only clone repos whose name matches the given regexp.") 51 52 excludePattern := flag.String("exclude", "", "don't mirror repos whose names match this regexp.") 53 + lastActivityAfter := flag.String("last_activity_after", "", "only mirror repos that have been active since this date (format: 2006-01-02).") 52 54 flag.Parse() 53 55 54 56 if *dest == "" { ··· 88 90 } 89 91 if *isPublic { 90 92 opt.Visibility = gitlab.Visibility(gitlab.PublicVisibility) 93 + } 94 + 95 + if *lastActivityAfter != "" { 96 + targetDate, err := time.Parse("2006-01-02", *lastActivityAfter) 97 + if err != nil { 98 + log.Fatal(err) 99 + } 100 + opt.LastActivityAfter = gitlab.Time(targetDate) 91 101 } 92 102 93 103 var gitlabProjects []*gitlab.Project