From e4769df09034e8f5cdea1b941b2e260e91f14c15 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 29 Feb 2024 19:51:56 -0600 Subject: [PATCH] change for changes in GitPull() --- configfile.go | 24 ++++++++---------------- viewGuiReleaser.go | 2 +- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/configfile.go b/configfile.go index 98543c6..78a1527 100644 --- a/configfile.go +++ b/configfile.go @@ -1,13 +1,14 @@ package repolist import ( - "fmt" + "errors" "io/ioutil" "os" "path/filepath" "strings" "go.wit.com/log" + "go.wit.com/lib/gui/repostatus" ) func (v *RepoList) InitRepoList(cfgfile string) { @@ -115,30 +116,21 @@ func (rl *RepoList) ArgGitPull() bool { log.Log(REPOWARN, "running git pull everywhere") var failed int = 0 for _, repo := range rl.AllRepos() { - log.Log(REPOWARN, "Running:", repo.Status.Path()) - if err := repo.Status.GitPull(); err == nil { + if out, err := repo.Status.GitPull(); err == nil { + log.Log(REPOWARN, "Ran git pull ok", repo.Status.Path(), out) } else { failed += 1 repo.Status.DumpTags() - name := repo.Status.GetCurrentBranchName() - if repo.Status.IsOnlyLocalTag(name) { - log.Log(REPOWARN, repo.Status.Path(), "can not git pull on local only branch", name, err) - } else { - log.Log(REPOWARN, repo.Status.Path(), "this branch should have worked", name, err) - } - if fmt.Sprint(err) == "git config error" { - badmap += 1 - continue - } - if fmt.Sprint(err) == "local only" { + if errors.Is(repostatus.ErrorGitPullOnLocal, err) { localonly += 1 continue } - return false + badmap += 1 + log.Log(REPOWARN, "bad unknown git error", repo.Status.Path(), out, err) } } log.Log(REPOWARN, "Ran git pull in all repos. failure count =", failed) - log.Log(REPOWARN, "Ran git pull in all repos. git config map errors =", badmap) + log.Log(REPOWARN, "Ran git pull in all repos. bad errors =", badmap) if localonly != 0 { log.Log(REPOWARN, "Ran git pull in all repos. ignored local only branches =", localonly) } diff --git a/viewGuiReleaser.go b/viewGuiReleaser.go index 96e3c24..972ae1d 100644 --- a/viewGuiReleaser.go +++ b/viewGuiReleaser.go @@ -24,7 +24,7 @@ func GuireleaserView(parent *gui.Node) *RepoList { me.reposgrid.NewLabel("Current") me.reposgrid.NewLabel("Version") me.reposgrid.NewLabel("git State") - me.reposgrid.NewLabel("GO State") + // me.reposgrid.NewLabel("GO State") me.reposgrid.NextRow() me.blind = gui.RawBox()