From e0277684a44d05fc65c789424829dc16bc19f7b9 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 17 Oct 2025 14:35:07 -0500 Subject: from forgepb --- tableForged.go | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 tableForged.go diff --git a/tableForged.go b/tableForged.go new file mode 100644 index 0000000..fe86c08 --- /dev/null +++ b/tableForged.go @@ -0,0 +1,64 @@ +// Copyright 2025 WIT.COM Inc Licensed GPL 3.0 + +package gitpb + +import ( + "go.wit.com/log" +) + +func (pb *Repos) PrintForgedTable() string { + tablePB := pb.MakeForgedTable() + tablePB.PrintTable() + return log.Sprintf("fpb.ForgedTable: %d repos", pb.Len()) +} + +func (pb *Repos) MakeForgedTable() *ReposTable { + t := pb.NewTable("forgedList") + t.NewUuid() + + var col *RepoFunc + + col = t.AddMasterBranchName() + col.Width = 3 + + col = t.AddMasterVersion() + col.Width = 10 + + col = t.AddStringFunc("hash", func(r *Repo) string { + if r.Tags == nil { + return "nil" + } + if r.Tags.Master == nil { + return "nil" + } + return r.Tags.Master.Hash + }) + col.Width = 6 + + col = t.AddDevelBranchName() + col.Width = 3 + + col = t.AddDevelVersion() + col.Width = 10 + + col = t.AddStringFunc("hash", func(r *Repo) string { + if r.Tags == nil { + return "nil" + } + if r.Tags.Devel == nil { + return "nil" + } + return r.Tags.Devel.Hash + }) + col.Width = 6 + + col = t.AddState() + col.Width = 16 + + col = t.AddNamespace() + col.Width = 42 + + col = t.AddURL() + col.Width = -1 + return t +} -- cgit v1.2.3