diff --git a/common.go b/common.go index 42a0c30..6c8e97e 100644 --- a/common.go +++ b/common.go @@ -100,39 +100,6 @@ func (r *RepoRow) LastTag() string { return r.lastTag.String() } -/* -// returns the state of the GO go.mod and go.sum files -// this is used to tell if they are valid and correctly reflect -// the versions of the other GUI packages -// at this point in time, there is _NO_ way to be check our -// be sure that anything will run with older versions -// because this are changing too often at this point -// TODO: revisit this in 2025 or 2026 -func (r *RepoRow) GoState() string { - if r == nil { - log.Info("GoState() r == nil") - return "goState == nil" - } - if r.goState == nil { - log.Info("GoState() r.goState == nil") - return "goState == nil" - } - return r.goState.String() -} - -func (r *RepoRow) SetGoState(s string) { - if r == nil { - log.Info("SetGoState() r == nil") - return - } - if r.goState == nil { - log.Info("goState == nil") - return - } - r.goState.SetText(s) -} -*/ - func (r *RepoRow) IsPerfect() bool { if r.gitState.String() == "PERFECT" { return true diff --git a/human.go b/human.go index ab2544b..6e1dece 100644 --- a/human.go +++ b/human.go @@ -22,28 +22,8 @@ func (r *RepoRow) StandardHeader() string { devel := r.Status.GetDevelVersion() user := r.Status.GetUserVersion() - header := fmt.Sprintf("%-35s %5s %-10s %-10s %-10s %-10s %-15s", r.Name(), shell.FormatDuration(dur), lastTag, master, devel, user, r.State()) - return header -} - -// makes a human readable thing for standard out. -func (r *RepoRow) StandardReleaseHeader() string { - lastTag := r.LastTag() - tag := r.Status.NewestTag() - gitAge, _ := tag.GetDate() - dur := time.Since(gitAge) - - master := r.Status.GetMasterVersion() - target := r.Status.GetTargetVersion() - - header := fmt.Sprintf("%-35s %5s %-10s %-10s %-10s %-15s %-15s", - r.Name(), - shell.FormatDuration(dur), - lastTag, - master, - target, - r.GoState(), - r.State()) + header := fmt.Sprintf("%-35s %5s %-20s %-20s %-20s %-20s %-15s", + r.Name(), shell.FormatDuration(dur), lastTag, master, devel, user, r.State()) return header } @@ -56,6 +36,12 @@ func msg(w http.ResponseWriter, s string) { func (v *RepoList) PrintReport(w http.ResponseWriter, readonly string, onlydirty string, perfect string) { var count int + header := fmt.Sprintf("%-35s %5s %-20s %-20s %-20s %-20s %-15s", + "REPO", "AGE", + "LAST", "MASTER", "DEVEL", "USER", + "STATE") + msg(w, header) + loop := v.ReposSortByName() for loop.Scan() { repo := loop.Repo() @@ -93,9 +79,40 @@ func (v *RepoList) PrintReport(w http.ResponseWriter, readonly string, onlydirty msg(w, fmt.Sprintf("EVERYTHING WORKED repo count = %d", count)) } +// makes a human readable thing for standard out. +func (r *RepoRow) StandardReleaseHeader() string { + lastTag := r.LastTag() + tag := r.Status.NewestTag() + gitAge, _ := tag.GetDate() + dur := time.Since(gitAge) + + curname := r.Status.GetCurrentBranchName() + master := r.Status.GetMasterVersion() + user := r.Status.GetUserVersion() + target := r.Status.GetTargetVersion() + + header := fmt.Sprintf("%-35s %5s %-10s %-10s %-10s %-10s %-20s %-15s", + r.Name(), + shell.FormatDuration(dur), + curname, + lastTag, + master, + target, + user, + r.State()) + return header +} + + func (v *RepoList) PrintReleaseReport(w http.ResponseWriter, readonly string, perfect string) { var count int + header := fmt.Sprintf("%-35s %5s %-10s %-10s %-10s %-10s %-20s %-15s", + "REPO", "AGE", "CUR BR", + "LAST", "MASTER", "TARGET", "USER", + "STATE") + msg(w, header) + loop := v.ReposSortByName() for loop.Scan() { repo := loop.Repo() @@ -106,6 +123,9 @@ func (v *RepoList) PrintReleaseReport(w http.ResponseWriter, readonly string, pe if (repo.State() == "PERFECT") && (perfect == "true") { continue } + if repo.Status.IsReleased() { + continue + } count += 1 header := repo.StandardReleaseHeader() msg(w, header)