summaryrefslogtreecommitdiff
path: root/common.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-11-04 02:14:54 -0600
committerJeff Carr <[email protected]>2024-11-04 02:14:54 -0600
commit98926bf2f80a25e51429d74182254da1103bdbc7 (patch)
tree15f7dba8217d883411e212b0ee8db4f490b9a244 /common.go
parent8c415947df3ed66ec4207266b457136e30263568 (diff)
ignore new repos until init()
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'common.go')
-rw-r--r--common.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/common.go b/common.go
index d913598..2dc38ef 100644
--- a/common.go
+++ b/common.go
@@ -5,8 +5,10 @@ import (
"os"
"path/filepath"
"sort"
+ "time"
"go.wit.com/gui"
+ "go.wit.com/lib/gui/shell"
"go.wit.com/lib/gui/repostatus"
"go.wit.com/log"
)
@@ -23,6 +25,11 @@ func (r *RepoList) Hide() {
r.reposbox.Hide()
}
+// better name: use this
+func (r *RepoList) FindRepoByName(path string) *RepoRow {
+ return r.FindRepo(path)
+}
+
func (r *RepoList) FindRepo(path string) *RepoRow {
repo, _ := me.allrepos[path]
return repo
@@ -219,3 +226,18 @@ func (rl *RepoList) MakeGoWork() error {
fmt.Fprintln(f, ")")
return nil
}
+
+// makes a human readable thing for standard out.
+func (r *RepoRow) StandardHeader() string {
+ lastTag := r.LastTag()
+ tag := r.Status.NewestTag()
+ gitAge, _ := tag.GetDate()
+ dur := time.Since(gitAge)
+
+ master := r.Status.GetMasterVersion()
+ 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
+}