summaryrefslogtreecommitdiff
path: root/doTag.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-12 14:30:26 -0500
committerJeff Carr <[email protected]>2025-09-12 14:30:26 -0500
commit7c520aae88c78c9b12610e5cbd7a968844b2ca6a (patch)
treeb54c3805b942faf8e0857bb7613f19dcd43c97a0 /doTag.go
parent96a8f661380ca7a8314bcc05f761b73b089fa8b4 (diff)
add tag handling
Diffstat (limited to 'doTag.go')
-rw-r--r--doTag.go54
1 files changed, 54 insertions, 0 deletions
diff --git a/doTag.go b/doTag.go
new file mode 100644
index 0000000..d2d5ca6
--- /dev/null
+++ b/doTag.go
@@ -0,0 +1,54 @@
+// Copyright 2017-2025 WIT.COM Inc. All rights reserved.
+// Use of this source code is governed by the GPL 3.0
+
+package main
+
+// checks that repos are in a "normal" state
+
+import (
+ "time"
+
+ "go.wit.com/lib/protobuf/gitpb"
+ "go.wit.com/log"
+)
+
+func doTag() error {
+ if argv.Tag.List != nil {
+ log.Info("list tags here")
+ return nil
+ }
+
+ ns := "go.wit.com/apps/forge"
+ repo := me.forge.Repos.FindByNamespace(ns)
+ if repo == nil {
+ return log.Errorf("could not find %s", ns)
+ }
+
+ tagTablePB := makeTagTablePB(repo.Tags)
+ // tbox := win.Bottom.Box().SetProgName("TBOX")
+ // t.SetParent(tbox)
+ tagTablePB.MakeTable()
+ tagTablePB.PrintTable()
+
+ log.Info("do other tag stuff here")
+ return nil
+}
+
+func makeTagTablePB(pb *gitpb.GitTags) *gitpb.GitTagsTable {
+ t := pb.NewTable("tagList")
+ t.NewUuid()
+
+ sf := t.AddStringFunc("Ref Name", func(r *gitpb.GitTag) string {
+ return r.GetRefname()
+ })
+ sf.Width = 16
+
+ colAge := t.AddTimeFunc("age", func(repo *gitpb.GitTag) time.Time {
+ // todo
+ return time.Now()
+ })
+ t.AddHash()
+ t.AddSubject()
+ colAge.Width = 4
+ return t
+}