From 2b01cc8c01a82bf8c5fbecea831e61660d9103f7 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 7 Oct 2025 19:48:19 -0500 Subject: try again with stats --- doPull.go | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/doPull.go b/doPull.go index 2bc96de..17328fe 100644 --- a/doPull.go +++ b/doPull.go @@ -7,6 +7,7 @@ import ( "strings" "time" + "go.wit.com/lib/config" "go.wit.com/lib/gui/shell" "go.wit.com/lib/protobuf/forgepb" "go.wit.com/lib/protobuf/gitpb" @@ -165,16 +166,31 @@ func doPull() error { } if argv.Pull.Force || argv.Force { - now := time.Now() stats := me.forge.RillFuncError(rillPull) count := me.forge.RillReload() if count != 0 { me.forge.ConfigSave() } - - total, count, nope, _ := me.forge.IsEverythingOnMaster() - log.Printf("Master branch check. %d total repos. (%d git pulled) (%d not on master branch) (%s) git pull total=FIXME%d\n", total, count, nope, shell.FormatDuration(time.Since(now)), len(stats)) - return nil + repoerr := gitpb.NewRepos() + for path, stat := range stats { + if stat.Err == nil { + continue + } + repo := me.forge.Repos.FindByFullPath(path) + if repo == nil { + log.Info("path deleted while running?", path) + continue + } + r := repoerr.Append(repo) + r.State = "git pull failed" + dur := stat.End.Sub(stat.Start) + if dur > 1*time.Second { + msg := log.Sprintf("pull time (%s)", config.FormatDuration(dur)) + r.State = msg + } + } + me.forge.PrintPullTable(repoerr) + me.sh.GoodExit("git pull done") } log.Info("do a pull check here?") -- cgit v1.2.3