diff options
Diffstat (limited to 'find.go')
| -rw-r--r-- | find.go | 72 |
1 files changed, 72 insertions, 0 deletions
@@ -5,6 +5,7 @@ package main import ( "go.wit.com/lib/protobuf/gitpb" + "go.wit.com/log" ) // this populates a slice of protobuf records representing each git repo @@ -195,3 +196,74 @@ func findReposWithPatches() *gitpb.Repos { } return found } + +func cloneReposWithPatches() *gitpb.Repos { + found := gitpb.NewRepos() + + var stop int + + for repo := range me.forge.Repos.IterByFullPath() { + if repo.IsDirty() { + // always add dirty branches + r := found.Clone(repo) + r.State = "is dirty" + repo.State = "is dirty" + continue + } + if repo.GetUserVersion() == "" { + // skip anything without a user branch + if !repo.IsLocalBranchVerbose(repo.GetUserBranchName()) { + // everthing is actually normal + } + stop += 1 + if stop < 5 { + for t := range repo.Tags.IterAll() { + log.Info(repo.Namespace, t.Refname) + } + } else { + panic("stop") + } + // no user branch + r := found.Clone(repo) + r.State = log.Sprintf("no br '%s'", repo.GetUserBranchName()) + continue + } + if repo.GetUserVersion() == "uerr" { + // skip anything without a user branch + r := found.Clone(repo) + r.State = "user == 'uerr'" + continue + } + if repo.GetUserVersion() != repo.GetDevelVersion() { + r := found.Clone(repo) + r.State = "user != dev" + continue + } + + // ignore read-only repos for checks below here + if me.forge.Config.IsReadOnly(repo.Namespace) { + continue + } + + // show anything that differs between 'devel' & 'master' branches + if repo.GetDevelVersion() != repo.GetMasterVersion() { + // this repo.State code isn't great, but it got me here quickly + // I'll defend my code by saying it's faster for me if I do dumb things + // sometimes and fix them later. Probably some employee will have to + // fix this. if that is the case I owe you lunch. or stock options + // log.Info("repo state", repo.FullPath, repo.State) + r := found.Clone(repo) + r.State = "DEVEL behind MASTER" + continue + } + + // this is an old test to see if the current 'last tag' is accurate and should be removed + if repo.GetLastTag() != repo.GetMasterVersion() { + r := found.Clone(repo) + r.FindLastTag() + r.State = "lasttag mismatch" + continue + } + } + return found +} |
