summaryrefslogtreecommitdiff
path: root/tagWindow.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-02-17 08:39:09 -0600
committerJeff Carr <[email protected]>2024-02-17 08:39:09 -0600
commit0e26f2024af04dc4dc36cde77e561b9692b1a64f (patch)
treedb806aef6c449002702912e7023be152797013ad /tagWindow.go
parent45519f2370aa00243f823ef949b1f7d4fb359cb2 (diff)
changes for repolist package
Diffstat (limited to 'tagWindow.go')
-rw-r--r--tagWindow.go36
1 files changed, 18 insertions, 18 deletions
diff --git a/tagWindow.go b/tagWindow.go
index f6a349d..05d9087 100644
--- a/tagWindow.go
+++ b/tagWindow.go
@@ -10,7 +10,7 @@ import (
"go.wit.com/log"
)
-type repoTag struct {
+type Tag struct {
// tracks if the tag is displayed
hidden bool
@@ -31,14 +31,14 @@ type repoTag struct {
}
// a GUI box of all the tags in a repo
-type gitTagBox struct {
+type GitTagBox struct {
// the box to list all the tags in
box *gui.Node
group *gui.Node
grid *gui.Node
// all the tags
- tags []*repoTag
+ tags []*Tag
}
func (rs *RepoStatus) makeTagBox(box *gui.Node) {
@@ -46,7 +46,7 @@ func (rs *RepoStatus) makeTagBox(box *gui.Node) {
log.Log(WARN, "already scanned tags")
return
}
- tagB := new(gitTagBox)
+ tagB := new(GitTagBox)
rs.Tags = tagB
tagB.group = box.NewGroup(".git tags for " + rs.String())
@@ -103,7 +103,7 @@ func (rs *RepoStatus) makeTagBox(box *gui.Node) {
lines := strings.Split(output, "\n")
// reverse the git order
slices.Reverse(lines)
- tagB.tags = make([]*repoTag, 0)
+ tagB.tags = make([]*Tag, 0)
for i, line := range lines {
var parts []string
@@ -114,7 +114,7 @@ func (rs *RepoStatus) makeTagBox(box *gui.Node) {
continue
}
// log.Info("found tag:", i, parts)
- rTag := new(repoTag)
+ rTag := new(Tag)
rTag.tag = grid.NewLabel(parts[3])
rTag.ref = grid.NewEntrybox(parts[0])
@@ -145,16 +145,16 @@ func (rs *RepoStatus) makeTagBox(box *gui.Node) {
// slices.Reverse(rtags.tags)
}
-func (rtags *gitTagBox) ListAll() []*repoTag {
- var tags []*repoTag
+func (rtags *GitTagBox) ListAll() []*Tag {
+ var tags []*Tag
for _, t := range rtags.tags {
tags = append(tags, t)
}
return tags
}
-func (rtags *gitTagBox) List() []*repoTag {
- var tags []*repoTag
+func (rtags *GitTagBox) List() []*Tag {
+ var tags []*Tag
for _, t := range rtags.tags {
if t.hidden {
// log.Info("tag is hidden", i, t.tag.String())
@@ -166,8 +166,8 @@ func (rtags *gitTagBox) List() []*repoTag {
return tags
}
-func (rtags *gitTagBox) Prune() {
- dups := make(map[string]*repoTag)
+func (rtags *GitTagBox) Prune() {
+ dups := make(map[string]*Tag)
for i, t := range rtags.tags {
if t == nil {
log.Info("tag empty:", i)
@@ -187,11 +187,11 @@ func (rtags *gitTagBox) Prune() {
}
// hide tags worth keeping
-func (rtags *gitTagBox) PruneSmart() {
+func (rtags *GitTagBox) PruneSmart() {
// always keep the first tag
var first bool = true
- dups := make(map[string]*repoTag)
+ dups := make(map[string]*Tag)
for i, t := range rtags.tags {
if t == nil {
log.Info("tag empty:", i)
@@ -240,7 +240,7 @@ func (rtags *gitTagBox) PruneSmart() {
// deleting it locally triggers some but when
// the git server was uncontactable (over IPv6 if that matters, probably it doesn't)
// and then the local delete re-added it into the tag
-func (rs *RepoStatus) DeleteTag(rt *repoTag) {
+func (rs *RepoStatus) DeleteTag(rt *Tag) {
cmd := []string{"git", "push", "--delete", "origin", rt.tag.String()}
log.Info("RUN:", cmd)
err, output := rs.RunCmd(cmd)
@@ -261,11 +261,11 @@ func (rs *RepoStatus) DeleteTag(rt *repoTag) {
}
-func (rt *repoTag) TagString() string {
+func (rt *Tag) TagString() string {
return rt.tag.String()
}
-func (rt *repoTag) Hide() {
+func (rt *Tag) Hide() {
rt.hidden = true
rt.tag.Hide()
rt.ref.Hide()
@@ -274,7 +274,7 @@ func (rt *repoTag) Hide() {
rt.deleteB.Hide()
}
-func (rt *repoTag) Show() {
+func (rt *Tag) Show() {
rt.hidden = false
rt.tag.Show()
rt.ref.Show()