From ca66a42fd16d9724d5dc8acd7516f623fa65e00e Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 7 Jan 2025 04:58:42 -0600 Subject: [PATCH] remove lots of old stuff --- common.go | 4 ++++ getPatches.go | 7 ++----- newRepo.go | 2 +- scan.go | 26 ++------------------------ 4 files changed, 9 insertions(+), 30 deletions(-) diff --git a/common.go b/common.go index 6b67649..12d438a 100644 --- a/common.go +++ b/common.go @@ -27,6 +27,10 @@ func (r *RepoRow) IsProtobuf() (bool, []string, error) { return r.pb.IsProtobuf() } +func (r *RepoRow) IsBinary() bool { + return r.pb.GoInfo.GetGoBinary() +} + // better name: use this // matches by path or by name func (r *RepoList) FindByName(name string) *RepoRow { diff --git a/getPatches.go b/getPatches.go index f5875ca..46e8587 100644 --- a/getPatches.go +++ b/getPatches.go @@ -1,12 +1,7 @@ package repolist import ( - "os" - "path/filepath" - "strings" - "go.wit.com/lib/gui/repostatus" - "go.wit.com/log" ) type Patch struct { @@ -18,6 +13,7 @@ type Patch struct { // move all this to repolist and gowit repos +/* func (repo *RepoRow) GetPatches(oldname string, newname string) (int, []*Patch) { var patchcount int patches := make([]*Patch, 0, 0) @@ -113,3 +109,4 @@ func (r *RepoList) MakePatchset(setdir string) bool { } return true } +*/ diff --git a/newRepo.go b/newRepo.go index 57561f7..5933f11 100644 --- a/newRepo.go +++ b/newRepo.go @@ -111,7 +111,7 @@ func (r *RepoList) AddRepo(pb *gitpb.Repo) (*RepoRow, error) { }) newRepo.endBox.NewButton("commit all", func() { - if !newRepo.Status.IsUserBranch() { + if !newRepo.pb.IsUserBranch() { log.Log(REPOWARN, "can not commit on non user branch") return } diff --git a/scan.go b/scan.go index 56c5b23..f0edf37 100644 --- a/scan.go +++ b/scan.go @@ -73,8 +73,8 @@ func (r *RepoRow) NewScan2(pb *gitpb.Repo) int { r.develVersion.SetLabel(pb.GetDevelVersion()) r.userVersion.SetLabel(pb.GetUserVersion()) r.gitState.SetLabel(r.Status.GitState()) - r.currentName.SetLabel(r.Status.GetCurrentBranchName()) - r.currentVersion.SetLabel(r.Status.GetCurrentBranchVersion()) + r.currentName.SetLabel(pb.GetCurrentBranchName()) + r.currentVersion.SetLabel(pb.GetCurrentBranchVersion()) if r.State() == "merge to main" { r.Hide() @@ -85,28 +85,6 @@ func (r *RepoRow) NewScan2(pb *gitpb.Repo) int { r.Show() } - /* - tags := []string{"%(objectname)", "%(creatordate)", "%(*authordate)", "%(refname)", "%(subject)"} - format := strings.Join(tags, "_,,,_") - cmd := []string{"git", "for-each-ref", "--sort=taggerdate", "--format", format} - // log.Info("RUNNING:", strings.Join(cmd, " ")) - result := r.pb.RunQuiet(cmd) - if result.Error != nil { - log.Warn("git for-each-ref error:", result.Error) - } - for i, line := range result.Stdout { - log.Info(i, line) - } - - if me.hideFunction == nil { - // application didn't register a hide function - // always show everything in that case - r.Show() - } else { - me.hideFunction(r) - } - */ - // print out whatever changes have happened if c, ok := r.Status.Changed(); ok { log.Log(REPOWARN, "something finally changed")