From f4ac4914906110c3a1a4a5fc29336e11122500ca Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 19 Jan 2025 02:37:31 -0600 Subject: [PATCH] debugging, but runs ok --- goSrcScan.go | 2 +- humanTable.go | 12 +++++++----- repoNew.go | 10 ++++++++++ 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/goSrcScan.go b/goSrcScan.go index a934b15..fd61b47 100644 --- a/goSrcScan.go +++ b/goSrcScan.go @@ -177,7 +177,7 @@ func (f *Forge) RillRedoGoMod() int { log.Printf("%10s %-50s", "why am I in RillRedoGoMod? old?", repo.GetGoPath()) continue } - all = append(all, repo) + f.Repos.Append(repo) } // Convert a slice of user IDs into a channel ids := rill.FromSlice(all, nil) diff --git a/humanTable.go b/humanTable.go index 7a128fd..22df766 100644 --- a/humanTable.go +++ b/humanTable.go @@ -38,7 +38,7 @@ func (f *Forge) PrintHumanTable(allr *gitpb.Repos) { var count int // log.Info(standardStart5("gopath", "cur name", "master", "user", "repo type")) - log.Info(standardTable8("repopath", "cur br", "age", "target", "master", "devel", "user", "curver", "repo type")) + log.Info(standardTable8("repopath", "cur br", "age", "master", "devel", "user", "curver", "next", "repo type")) all := allr.SortByFullPath() for all.Scan() { repo := all.Next() @@ -54,7 +54,7 @@ func (f *Forge) PrintHumanTableDirty(allr *gitpb.Repos) { var count int // log.Info(standardStart5("gopath", "cur name", "master", "user", "repo type")) - log.Info(standardTable8("repopath", "cur br", "age", "master", "devel", "user", "curver", "target", "repo type")) + log.Info(standardTable8("repopath", "cur br", "age", "master", "devel", "user", "curver", "next", "repo type")) // all := allr.SortByFullPath() all := allr.All() for all.Scan() { @@ -161,9 +161,6 @@ func standardTable8(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 string) func (f *Forge) printRepoToTable(repo *gitpb.Repo) { var end string - if repo.IsDirty() { - end += "(dirty) " - } // shortened version numbers var mhort string = repo.GetMasterVersion() @@ -180,6 +177,11 @@ func (f *Forge) printRepoToTable(repo *gitpb.Repo) { // age := shell.FormatDuration(time.Since(ctime)) age := shell.FormatDuration(repo.NewestAge()) + if repo.IsDirty() { + age = "" + end += "(dirty) " + } + start := standardTable8(gopath, cname, age, mhort, dhort, uhort, chort, thort, rtype) if f.Config.IsReadOnly(repo.GetGoPath()) { diff --git a/repoNew.go b/repoNew.go index d5caa18..1b8173a 100644 --- a/repoNew.go +++ b/repoNew.go @@ -5,6 +5,7 @@ import ( "os" "path/filepath" "regexp" + "slices" "strings" "go.wit.com/lib/protobuf/gitpb" @@ -13,11 +14,20 @@ import ( func (f *Forge) NewGoRepo(gopath string, url string) (*gitpb.Repo, error) { fullpath := filepath.Join(f.GetGoSrc(), gopath) + test := f.Repos.FindByFullPath(fullpath) + if test != nil { + return test, nil + } + log.Info("LEN START", f.Repos.Len()) repo, err := f.Repos.NewGoRepo(fullpath, gopath) if err != nil { log.Info("WARNING. NEW FAILED", fullpath) return nil, err } + log.Info("LEN END", f.Repos.Len()) + slices.Reverse(f.Repos.Repos) + log.Info("LEN END", f.Repos.Len()) + repo.URL = url f.VerifyBranchNames(repo) if f.Config.IsReadOnly(repo.GetGoPath()) {