From 4eada310b83d28d6406a6e44d453749e1ed9502a Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 23 Sep 2025 09:36:15 -0500 Subject: [PATCH] make a standard set.PrintTable() --- patchset.Make.go | 4 +-- set.table.go | 64 ++++++++++++++++++++++-------------------------- 2 files changed, 31 insertions(+), 37 deletions(-) diff --git a/patchset.Make.go b/patchset.Make.go index 75c4215..c8bfdc0 100644 --- a/patchset.Make.go +++ b/patchset.Make.go @@ -140,7 +140,7 @@ func (pset *Set) makePatchSetNew(repo *gitpb.Repo) error { err = pset.addPatchFiles(repo, repoDir) log.Infof("Added %d patches for %s len=%d\n", len(r.Stdout), repo.FullPath, pset.Patches.Len()) - pset.PrintTable() + // pset.PrintTable() return err } @@ -186,7 +186,7 @@ func (p *Set) addPatchFiles(repo *gitpb.Repo, fullDir string) error { p.Patches = new(Patches) } p.Patches.Append(patch) - log.Info("ADDED PATCH FILE", path) + // log.Info("ADDED PATCH FILE", path) return nil }) return baderr diff --git a/set.table.go b/set.table.go index 8194346..2d8f1ac 100644 --- a/set.table.go +++ b/set.table.go @@ -20,41 +20,8 @@ func (pset *Set) PrintTable() { tablePB.PrintTable() } -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.AddTimeFunc("age", func(repo *gitpb.GitTag) time.Time { - // todo - return time.Now() - }) - col.Width = 4 - - col = t.AddStringFunc("Ref Name", func(r *gitpb.GitTag) string { - _, ref := filepath.Split(r.GetRefname()) - return ref - }) - col.Width = 16 - */ - - col = t.AddComment() - col.Width = -1 - - return t -} - func (mt *PatchesTable) PrintTable() { - // log.Info("ShowTable() SENDING TO GUI") + log.Info("ShowTable() SENDING TO GUI") mt.MakeTable() cobol.PrintTable(mt.pb) } @@ -64,7 +31,7 @@ func (pb *Patches) makeStandardTable() *PatchesTable { t.NewUuid() col := t.AddNamespace() - col.Width = 12 + col.Width = 28 col = t.AddTimeFunc("ctime", func(p *Patch) time.Time { // todo @@ -86,8 +53,35 @@ func (pb *Patches) makeStandardTable() *PatchesTable { col.Width = 16 */ + col = t.AddPatchId() + col.Width = 8 + + col = t.AddComment() + col.Width = 16 + + col = t.AddFilename() + col.Width = 30 + + 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 } +*/