diff options
| author | Jeff Carr <[email protected]> | 2025-02-22 04:54:06 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-02-22 04:54:06 -0600 |
| commit | 3d58bc1c327a84f38516bce7da029493cb8beb4a (patch) | |
| tree | 85109bb062fae8b01743ebf36f06cc70bf0539a3 | |
| parent | 6eb37f63f2379bfe9e5ee308ed1a359f3f78178c (diff) | |
rm old code
| -rw-r--r-- | argv.go | 7 | ||||
| -rw-r--r-- | doVerifyDevel.go | 93 | ||||
| -rw-r--r-- | doVerifyUser.go | 37 | ||||
| -rw-r--r-- | main.go | 5 |
4 files changed, 0 insertions, 142 deletions
@@ -47,16 +47,9 @@ type CleanCmd struct { 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"` } -type VerifyCmd struct { - User *FindCmd `arg:"subcommand:user" help:"verify the user branches"` - Devel *FindCmd `arg:"subcommand:devel" help:"verify the devel branches"` - Master *FindCmd `arg:"subcommand:master" help:"verify the master branches"` -} - type CleanDevelCmd struct { Force bool `arg:"--force" help:"try to strong arm things"` } diff --git a/doVerifyDevel.go b/doVerifyDevel.go deleted file mode 100644 index 51fec2c..0000000 --- a/doVerifyDevel.go +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2017-2025 WIT.COM Inc. All rights reserved. -// Use of this source code is governed by the GPL 3.0 - -package main - -import ( - "go.wit.com/lib/protobuf/gitpb" - "go.wit.com/log" -) - -func doVerifyDevel() error { - me.found = new(gitpb.Repos) - all := me.forge.Repos.SortByFullPath() - for all.Scan() { - repo := all.Next() - if repo.IsDirty() { - log.Info(repo.GetGoPath(), "is dirty") - continue - } - if repo.GetDevelBranchName() == "" { - continue - } - if repo.GetMasterBranchName() != repo.GetCurrentBranchName() { - log.Info(repo.GetGoPath(), "is not on master branch") - continue - } - - devel := repo.GetDevelBranchName() - if argv.Verbose { - log.Printf("Start clean devel branch: %s %s\n", repo.GetGoPath(), devel) - } - - /* - // check if devel branch exists in remote repo - if repo.IsBranchRemote(devel) { - if err := doCleanDevelRepo(repo); err != nil { - log.Info(repo.GetGoPath(), "verify clean failed") - } - // can not continue - continue - } - */ - // devel branch is only local - /* - todo: something? - devname := repo.GetDevelBranchName() - if err := requiresGitPush(repo, devname); err != nil { - log.Info(repo.GetGoPath(), "is out of sync with upstream") - return err - } - */ - } - return nil -} - -/* - err = fmt.Errorf("examineBranch() branch differs. patch diff len == 0. PROBABLY DELETE BRANCH %s", repo.CurrentTag.Refname) - log.Info(err) - cmd := repo.ConstructGitDiffLog(repo.CurrentTag.Refname, repo.GetMasterBranchName()) - if argv.Clean.Examine.Fix == nil { - log.Info(repo.GetGoPath(), cmd) - } else { - if _, err := repo.RunVerbose(cmd); err != nil { - return err - } - } - cmd = repo.ConstructGitDiffLog(repo.GetMasterBranchName(), repo.CurrentTag.Refname) - if argv.Clean.Examine.Fix == nil { - log.Info(repo.GetGoPath(), cmd) - } else { - if _, err := repo.RunVerbose(cmd); err != nil { - return err - } - } - cmd = []string{"git", "branch", "-D", repo.CurrentTag.Refname} - log.Info(repo.GetGoPath(), "TRY THIS:", cmd) - if argv.Clean.Examine.Fix == nil { - log.Info(repo.GetGoPath(), "TODO: CHECK REMOTE BRANCH DOES NOT EXIST", repo.CurrentTag.Refname) - repo.RunVerbose([]string{"ls", "-l", ".git/refs/remotes/origin"}) - } else { - log.Info(repo.GetGoPath(), "TODO: CHECK REMOTE BRANCH DOES NOT EXIST", repo.CurrentTag.Refname) - if _, err := repo.RunVerbose(cmd); err != nil { - return err - } else { - return nil - } - } - return err - } - err = fmt.Errorf("examineBranch() branch differs, but not sure how to fix it yet == %d", len(dcount)) - log.Info(err) - return nil -*/ diff --git a/doVerifyUser.go b/doVerifyUser.go deleted file mode 100644 index ae1a0ff..0000000 --- a/doVerifyUser.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2017-2025 WIT.COM Inc. All rights reserved. -// Use of this source code is governed by the GPL 3.0 - -package main - -/* -func doVerifyUser() error { - me.found = new(gitpb.Repos) - all := me.forge.Repos.SortByFullPath() - for all.Scan() { - repo := all.Next() - if repo.IsDirty() { - log.Info(repo.GetGoPath(), "is dirty") - me.found.AppendByGoPath(repo) - continue - } - if repo.ExistsUserBranchRemote() { - } - - if repo.ExistsUserBranch() { - } - if repo.GetMasterBranchName() == repo.GetCurrentBranchName() { - log.Info(repo.GetGoPath(), "is not on master branch") - continue - } - - devel := repo.GetDevelBranchName() - if argv.Verbose { - log.Printf("Start clean devel branch: %s %s\n", repo.GetGoPath(), devel) - } - } - return nil -} - -func verifyRemoteUserBranch(repo *gitpb.Repo) { -} -*/ @@ -111,11 +111,6 @@ func main() { okExit("reset") } - if argv.Clean.Verify != nil { - doVerifyDevel() - okExit("verify") - } - if err := doClean(); err != nil { badExit(err) } |
