summaryrefslogtreecommitdiff
path: root/doClean.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-11 06:31:24 -0500
committerJeff Carr <[email protected]>2025-09-11 06:31:24 -0500
commit363460290d465cbf23f88097d4406f679e18c675 (patch)
tree06863ead12993b8fdf5ffebf70f6ebdccc0991b9 /doClean.go
parent309fcffc867f321f02885f809fecac06edf1ed06 (diff)
finally detecting state changes again
Diffstat (limited to 'doClean.go')
-rw-r--r--doClean.go23
1 files changed, 20 insertions, 3 deletions
diff --git a/doClean.go b/doClean.go
index fc04bdc..f072906 100644
--- a/doClean.go
+++ b/doClean.go
@@ -6,22 +6,29 @@ package main
import (
"fmt"
"path/filepath"
+ "time"
+ "go.wit.com/lib/gui/shell"
"go.wit.com/lib/protobuf/forgepb"
"go.wit.com/lib/protobuf/gitpb"
"go.wit.com/log"
)
func checkRemoteBranches(repo *gitpb.Repo) error {
+ if err := repo.ReloadCheck(); err != nil {
+ log.Info("need to reload", repo.FullPath)
+ }
if repo.VerifyRemoteAndLocalBranches(repo.GetDevelBranchName()) {
+ } else {
repo.Reload()
me.forge.SetConfigSave(true)
- return log.Errorf("devel is bad")
+ return log.Errorf("remote devel is out of sync with local")
}
if repo.VerifyRemoteAndLocalBranches(repo.GetMasterBranchName()) {
+ } else {
repo.Reload()
me.forge.SetConfigSave(true)
- return log.Errorf("master is bad")
+ return log.Errorf("remote master is out of sync with local")
}
return nil
}
@@ -33,7 +40,17 @@ func doClean() error {
if argv.Clean.Verify != nil {
stats := me.forge.RillRepos(checkRemoteBranches)
- _ = stats
+ for path, stat := range stats {
+ if stat.Err == nil {
+ continue
+ }
+ dur := stat.End.Sub(stat.Start)
+ if dur > time.Second {
+ log.Infof("%s checkRemoteBranches() took a long time (%s) (err=%v)\n", path, shell.FormatDuration(dur), stat.Err)
+ }
+ }
+ // log.Infof("%-60s, %-60s %v %s\n", stat.Start, stat.End.String(), dur, path)
+ // log.Infof("%-30v %s %v\n", dur, path, stat.Err)
return nil
}