From a0147a9f4fcb979d0f15f74e7ff56430b0b60786 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 6 Feb 2024 17:48:15 -0600 Subject: [PATCH] allow auto-pruning of .git tags Signed-off-by: Jeff Carr --- globalDisplayOptions.go | 45 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/globalDisplayOptions.go b/globalDisplayOptions.go index d6e4b7e..6efb287 100644 --- a/globalDisplayOptions.go +++ b/globalDisplayOptions.go @@ -84,7 +84,9 @@ func globalDisplayOptions(box *gui.Node) { filename := filepath.Join(goSrcDir, "go.work") f, err := os.OpenFile(filename, os.O_WRONLY|os.O_CREATE, 0600) - if err != nil { return } + if err != nil { + return + } defer f.Close() fmt.Fprintln(f, "go 1.21.4") fmt.Fprintln(f, "") @@ -100,6 +102,47 @@ func globalDisplayOptions(box *gui.Node) { fmt.Fprintln(f, ")") }) + group1.NewButton("list all tags", func() { + me.autotypistWindow.Disable() + defer me.autotypistWindow.Enable() + for _, repo := range me.allrepos { + tagsW := repo.status.TagsW + if tagsW == nil { + repo.status.TagWindow() + tagsW = repo.status.TagsW + // tagsW.Prune() + continue + } + allTags := tagsW.ListAll() + for _, t := range allTags { + log.Info("found tag:", t.TagString(), "from", repo.status.String()) + } + } + }) + + group1.NewButton("delete all dup tags", func() { + me.autotypistWindow.Disable() + defer me.autotypistWindow.Enable() + for _, repo := range me.allrepos { + tagsW := repo.status.TagsW + if tagsW == nil { + repo.status.TagWindow() + tagsW = repo.status.TagsW + tagsW.PruneSmart() + continue + } + deleteTags := tagsW.List() + for _, t := range deleteTags { + if me.autoDryRun.Checked() { + log.Info("delete tag --dry-run:", t.TagString(), "from", repo.status.String()) + } else { + log.Info("Deleting tag:", t.TagString(), "from", repo.status.String()) + // tagsW.Delete(t) + } + } + } + }) + group2 := vbox.NewGroup("Debugger") group2.NewButton("logging Window", func() { logsettings.LogWindow()