diff options
| author | Jeff Carr <[email protected]> | 2025-01-29 19:59:55 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-01-29 19:59:55 -0600 |
| commit | d493a55cfa5ac1d50c845643b46ee4c12a192dab (patch) | |
| tree | 785ba73aad155b15bbaad9a1466825152ef4e6bb | |
| parent | bab84d7c903dd53de1cb70cc45a23a5673fa51af (diff) | |
debugging releaser
| -rw-r--r-- | argv.go | 14 | ||||
| -rw-r--r-- | argvAutoshell.go | 2 | ||||
| -rw-r--r-- | doClean.go | 22 | ||||
| -rw-r--r-- | find.go | 16 |
4 files changed, 47 insertions, 7 deletions
@@ -47,6 +47,7 @@ type CleanCmd struct { Examine *ExamineCmd `arg:"subcommand:examine" help:"examine branches"` Force *EmptyCmd `arg:"subcommand:force" help:"do destructive stuff"` GitReset *EmptyCmd `arg:"subcommand:git-reset" help:"git reset --hard"` + Pub *EmptyCmd `arg:"subcommand:pub" help:"clean target version numbers"` User *EmptyCmd `arg:"subcommand:user" help:"clean the user branches"` Verify *VerifyCmd `arg:"subcommand:verify" help:"verify branches"` Repo string `arg:"--repo" help:"which repo to look at"` @@ -101,12 +102,13 @@ type DirtyCmd struct { } type FindCmd struct { - All bool `arg:"--all" help:"select every repo (the default)"` - Mine bool `arg:"--mine" help:"your repos as defined in the forge config"` - Favorites bool `arg:"--favorites" help:"your repos configured as favorites"` - Private bool `arg:"--private" help:"your private repos from your .config/forge/"` - Dirty bool `arg:"--dirty" help:"only use dirty git repos"` - User bool `arg:"--user" help:"show repos on the user branch"` + Pub *EmptyCmd `arg:"subcommand:pub" help:"fix .config/forge/ and/or repos.pb protobuf file"` + All bool `arg:"--all" help:"select every repo (the default)"` + Mine bool `arg:"--mine" help:"your repos as defined in the forge config"` + Favorites bool `arg:"--favorites" help:"your repos configured as favorites"` + Private bool `arg:"--private" help:"your private repos from your .config/forge/"` + Dirty bool `arg:"--dirty" help:"only use dirty git repos"` + User bool `arg:"--user" help:"show repos on the user branch"` // ReadOnly bool `arg:"--readonly" help:"include read-only repos"` } diff --git a/argvAutoshell.go b/argvAutoshell.go index caef069..ba1d983 100644 --- a/argvAutoshell.go +++ b/argvAutoshell.go @@ -39,7 +39,7 @@ func (args) doBashAuto() { case "examine": fmt.Println("fix") case "list": - fmt.Println("--all --mine --favorites --private") + fmt.Println("--all --mine --favorites --private pub") case "pull": fmt.Println("--verbose") case "patch": @@ -14,6 +14,13 @@ var ErrorMergeBranch error = fmt.Errorf("trunk has things not in the branch") var ErrorMergeTrunk error = fmt.Errorf("branch has things not in trunk") func doClean() error { + if argv.Clean.Pub != nil { + if err := doCleanPub(); err != nil { + badExit(err) + } + log.Info("finished attempt at cleaning devel branches") + return nil + } if argv.Clean.Devel != nil { if err := doCleanDevel(); err != nil { badExit(err) @@ -535,3 +542,18 @@ func countGitDiffLog(repo *gitpb.Repo, branch1, branch2 string) int { // log.Info("countDiffObjects()", cmd, len(r.Stdout), strings.Join(r.Stdout, " ")) return len(r.Stdout) } + +func doCleanPub() error { + total := 0 + all := me.forge.Repos.SortByFullPath() + for all.Scan() { + repo := all.Next() + if repo.GetTargetVersion() != "" { + repo.SetTargetVersion("") + configSave = true + total += 1 + } + } + log.Printf("clearing %d total repos\n", total) + return nil +} @@ -17,6 +17,11 @@ func (f *FindCmd) findRepos() { return } + if f.Pub != nil { + findPublishable() + return + } + if f.All { findAll() return @@ -114,6 +119,17 @@ func findUser() { } } +func findPublishable() { + all := me.forge.Repos.SortByFullPath() + for all.Scan() { + repo := all.Next() + if repo.GetTargetVersion() == "" { + continue + } + me.found.AppendByGoPath(repo) + } +} + func findReposWithPatches() { all := me.forge.Repos.SortByFullPath() for all.Scan() { |
