code moved to gitpb

This commit is contained in:
Jeff Carr 2024-12-06 01:50:03 -06:00
parent e25095f2e7
commit 7f1f8d4028
3 changed files with 27 additions and 52 deletions

View File

@ -1,39 +1,39 @@
package forgepb
import (
"errors"
"go.wit.com/lib/gui/repostatus"
"go.wit.com/log"
)
func (f *Forge) GitPull() bool {
var localonly int
var badmap int
f.Repos.RillGitPull(5, 5)
/*
log.Log(FORGEPBWARN, "running git pull everywhere")
var failed int = 0
loop := f.Repos.SortByGoPath()
for loop.Scan() {
repo := loop.Next()
if out, err := repo.GitPull(); err == nil {
log.Log(FORGEPBWARN, "Ran git pull ok", repo.GetGoPath(), out)
} else {
failed += 1
// repo.DumpTags()
if errors.Is(repostatus.ErrorGitPullOnLocal, err) {
localonly += 1
continue
var localonly int
var badmap int
log.Log(FORGEPBWARN, "running git pull everywhere")
var failed int = 0
for loop.Scan() {
repo := loop.Next()
if out, err := repo.GitPull(); err == nil {
log.Log(FORGEPBWARN, "Ran git pull ok", repo.GetGoPath(), out)
} else {
failed += 1
// repo.DumpTags()
if errors.Is(repostatus.ErrorGitPullOnLocal, err) {
localonly += 1
continue
}
badmap += 1
log.Log(FORGEPBWARN, "bad unknown git error", repo.GetGoPath(), out, err)
}
badmap += 1
log.Log(FORGEPBWARN, "bad unknown git error", repo.GetGoPath(), out, err)
}
}
log.Log(FORGEPBWARN, "Ran git pull in all repos. failure count =", failed)
log.Log(FORGEPBWARN, "Ran git pull in all repos. bad errors =", badmap)
if localonly != 0 {
log.Log(FORGEPBWARN, "Ran git pull in all repos. ignored local only branches =", localonly)
}
log.Log(FORGEPBWARN, "Ran git pull in all repos. failure count =", failed)
log.Log(FORGEPBWARN, "Ran git pull in all repos. bad errors =", badmap)
if localonly != 0 {
log.Log(FORGEPBWARN, "Ran git pull in all repos. ignored local only branches =", localonly)
}
*/
return true
}

View File

@ -108,31 +108,6 @@ func IsGitDir(dir string) bool {
return info.IsDir()
}
/*
// rill is awesome. long live rill
func rillAddDirs(gopaths []string) {
// Convert a slice of user IDs into a channel
ids := rill.FromSlice(gopaths, nil)
// Read users from the API.
// Concurrency = 20
dirs := rill.Map(ids, 20, func(id string) (*repolist.RepoRow, error) {
return me.repos.View.FindByName(id), nil
})
// Activate users.
// Concurrency = 10
err := rill.ForEach(dirs, 10, func(repo *repolist.RepoRow) error {
fmt.Printf("Repo found : %s\n", repo.GoPath())
repo.Run([]string{"git", "pull"})
return nil
})
// Handle errors
fmt.Println("Error:", err)
}
*/
// rill is awesome. long live rill
// attempt scan with rill
func (f *Forge) rillScanDirs(gopaths []string) (int, error) {

View File

@ -50,7 +50,7 @@ func Init() *Forge {
log.Warn("zoopb.ConfigLoad() failed", err)
os.Exit(-1)
}
// f.Machine.InitWit()
f.Machine.InitWit()
start := f.Repos.Len()
f.ScanGoSrc()