From 44d221697fa9e5edd81ec99a7041c726d42ba034 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 5 Nov 2024 03:14:27 -0600 Subject: [PATCH] show target version in the stdout report Signed-off-by: Jeff Carr --- human.go | 13 +++++++++---- scanIterator.go | 3 +++ structs.go | 2 ++ viewTempWindow.go | 8 ++++++++ 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/human.go b/human.go index ec2997c..cd322e7 100644 --- a/human.go +++ b/human.go @@ -18,12 +18,16 @@ func (r *RepoRow) StandardHeader() string { gitAge, _ := tag.GetDate() dur := time.Since(gitAge) + target := r.Status.GetTargetVersion() master := r.Status.GetMasterVersion() devel := r.Status.GetDevelVersion() user := r.Status.GetUserVersion() - header := fmt.Sprintf("%-35s %5s %-20s %-20s %-20s %-20s %-15s", - r.Name(), shell.FormatDuration(dur), lastTag, master, devel, user, r.State()) + header := fmt.Sprintf("%-35s %5s %-12s %-12s %-20s %-20s %-20s %-15s", + r.Name(), shell.FormatDuration(dur), + lastTag, target, + master, devel, user, + r.State()) return header } @@ -36,9 +40,10 @@ 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", + header := fmt.Sprintf("%-35s %5s %-12s %-12s %-20s %-20s %-20s %-15s", "REPO", "AGE", - "LAST", "MASTER", "DEVEL", "USER", + "LAST", "TARGET", + "MASTER", "DEVEL", "USER", "STATE") msg(w, header) diff --git a/scanIterator.go b/scanIterator.go index 482d16d..b021195 100644 --- a/scanIterator.go +++ b/scanIterator.go @@ -127,6 +127,9 @@ func (r *RepoList) selectUnmergedRepos() []*RepoRow { if repo.State() == "PERFECT" { continue } + if repo.Status.Whitelist { + continue + } if repo.Status.IsReleased() { continue } diff --git a/structs.go b/structs.go index 0758258..128426d 100644 --- a/structs.go +++ b/structs.go @@ -37,6 +37,8 @@ type RepoList struct { shownCount *gui.Node hideFunction func(*RepoRow) duration *gui.Node + + rows []*RepoRow } type RepoRow struct { diff --git a/viewTempWindow.go b/viewTempWindow.go index bd27506..402393c 100644 --- a/viewTempWindow.go +++ b/viewTempWindow.go @@ -32,6 +32,13 @@ func TempWindowView(parent *gui.Node) *RepoList { return tmp } +func (r *RepoList) ListRows() { + for i, row := range r.rows { + log.Warn("i, row:", i, row.Status.Name(), "curname", row.Status.GetCurrentBranchName()) + row.currentName.SetLabel(row.Status.GetCurrentBranchName()) + } +} + func (r *RepoList) ShowRepo(repo *RepoRow) error { // this is the gui grid. all the widgets get added here // at the end we tell the grid go to NextRow() @@ -84,5 +91,6 @@ func (r *RepoList) ShowRepo(repo *RepoRow) error { newRow.hidden = false r.reposgrid.NextRow() + r.rows = append(r.rows, newRow) return nil }