From 2ef9b8b5e409f5b5796d5d6e8516672b94dd0375 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 7 Oct 2025 01:28:18 -0500 Subject: rename --- set.table.go | 100 -------------------------------------------------------- tablePatches.go | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+), 100 deletions(-) delete mode 100644 set.table.go create mode 100644 tablePatches.go diff --git a/set.table.go b/set.table.go deleted file mode 100644 index 5bc2cb1..0000000 --- a/set.table.go +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright 2025 WIT.COM Inc Licensed GPL 3.0 - -package forgepb - -import ( - "time" - - "go.wit.com/log" -) - -func (pset *Set) PrintTable() { - if pset == nil || pset.Patches == nil { - return - } - log.DaemonMode(true) // don't timestamp lines - - tablePB := pset.Patches.makeStandardTable() - tablePB.MakeTable() - tablePB.PrintTable() -} - -func (pb *Sets) PrintTable() { - for pset := range pb.IterAll() { - if pset.Patches == nil { - continue - } - tablePB := pset.Patches.makeStandardTable() - tablePB.MakeTable() - tablePB.PrintTable() - } -} - -func (pb *Patches) PrintTable() { - log.DaemonMode(true) // don't timestamp lines - - tablePB := pb.makeStandardTable() - tablePB.PrintTable() -} - -func (pb *Patches) makeStandardTable() *PatchesTable { - t := pb.NewTable("tagList") - t.NewUuid() - - col := t.AddNamespace() - col.Width = 28 - - col = t.AddCommitHash() - col.Width = 8 - - col = t.AddPatchId() - col.Width = 8 - - col = t.AddNewHash() - col.Width = 8 - - col = t.AddTimeFunc("ctime", func(p *Patch) time.Time { - // todo - return p.Ctime.AsTime() - }) - col.Width = 4 - - /* - col = t.AddTimeFunc("age", func(repo *gitpb.GitTag) time.Time { - // todo - return time.Now() - }) - col.Width = 4 - */ - - // col = t.AddStringFunc("filename", func(p *Patch) string { - // _, base := filepath.Split(p.Filename) - // return base - // }) - // col.Width = 24 - - col = t.AddComment() - col.Width = 80 - return t -} - -/* -func (pb *Sets) makeStandardTablePB() *SetsTable { - t := pb.NewTable("tagList") - t.NewUuid() - - col := t.AddUuid() - col.Width = 12 - - col = t.AddTimeFunc("ctime", func(pset *Set) time.Time { - // todo - return pset.Ctime.AsTime() - }) - col.Width = 4 - - col = t.AddComment() - col.Width = -1 - - return t -} -*/ diff --git a/tablePatches.go b/tablePatches.go new file mode 100644 index 0000000..5bc2cb1 --- /dev/null +++ b/tablePatches.go @@ -0,0 +1,100 @@ +// Copyright 2025 WIT.COM Inc Licensed GPL 3.0 + +package forgepb + +import ( + "time" + + "go.wit.com/log" +) + +func (pset *Set) PrintTable() { + if pset == nil || pset.Patches == nil { + return + } + log.DaemonMode(true) // don't timestamp lines + + tablePB := pset.Patches.makeStandardTable() + tablePB.MakeTable() + tablePB.PrintTable() +} + +func (pb *Sets) PrintTable() { + for pset := range pb.IterAll() { + if pset.Patches == nil { + continue + } + tablePB := pset.Patches.makeStandardTable() + tablePB.MakeTable() + tablePB.PrintTable() + } +} + +func (pb *Patches) PrintTable() { + log.DaemonMode(true) // don't timestamp lines + + tablePB := pb.makeStandardTable() + tablePB.PrintTable() +} + +func (pb *Patches) makeStandardTable() *PatchesTable { + t := pb.NewTable("tagList") + t.NewUuid() + + col := t.AddNamespace() + col.Width = 28 + + col = t.AddCommitHash() + col.Width = 8 + + col = t.AddPatchId() + col.Width = 8 + + col = t.AddNewHash() + col.Width = 8 + + col = t.AddTimeFunc("ctime", func(p *Patch) time.Time { + // todo + return p.Ctime.AsTime() + }) + col.Width = 4 + + /* + col = t.AddTimeFunc("age", func(repo *gitpb.GitTag) time.Time { + // todo + return time.Now() + }) + col.Width = 4 + */ + + // col = t.AddStringFunc("filename", func(p *Patch) string { + // _, base := filepath.Split(p.Filename) + // return base + // }) + // col.Width = 24 + + col = t.AddComment() + col.Width = 80 + return t +} + +/* +func (pb *Sets) makeStandardTablePB() *SetsTable { + t := pb.NewTable("tagList") + t.NewUuid() + + col := t.AddUuid() + col.Width = 12 + + col = t.AddTimeFunc("ctime", func(pset *Set) time.Time { + // todo + return pset.Ctime.AsTime() + }) + col.Width = 4 + + col = t.AddComment() + col.Width = -1 + + return t +} +*/ -- cgit v1.2.3