added way to unwind missed repos

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-02-05 19:27:19 -06:00
parent 7f0f36a886
commit a0f5c25e2f
4 changed files with 91 additions and 15 deletions

View File

@ -3,6 +3,7 @@ package main
import ( import (
"os" "os"
"strings"
"go.wit.com/gui" "go.wit.com/gui"
"go.wit.com/lib/debugger" "go.wit.com/lib/debugger"
@ -109,6 +110,9 @@ func globalDisplayOptions(box *gui.Node) {
if whitelist(repo.String()) { if whitelist(repo.String()) {
continue continue
} }
if repo.status.ReadOnly() {
continue
}
if repo.status.MakeRedomod() { if repo.status.MakeRedomod() {
log.Info("redo go.sum failed on", repo.String()) log.Info("redo go.sum failed on", repo.String())
// me.Enable() // me.Enable()
@ -128,6 +132,9 @@ func globalDisplayOptions(box *gui.Node) {
if whitelist(repo.String()) { if whitelist(repo.String()) {
continue continue
} }
if repo.status.ReadOnly() {
continue
}
repo.status.RunCmd([]string{"rm", "-f", "go.mod", "go.sum"}) repo.status.RunCmd([]string{"rm", "-f", "go.mod", "go.sum"})
} }
me.Enable() me.Enable()
@ -146,6 +153,49 @@ func globalDisplayOptions(box *gui.Node) {
me.Enable() me.Enable()
}) })
group1.NewButton("git ls-files |grep go.mod", func() {
// var all []string
for _, repo := range me.allrepos {
log.Info("repo:", repo.String())
if repo.status.ReadOnly() {
continue
}
if whitelist(repo.String()) {
log.Warn("skipping whitelist", repo.String())
continue
}
good, files := repo.status.GitLsFiles()
if !good {
log.Warn("Something went wrong", repo.String())
continue
}
for _, filename := range strings.Split(files, "\n") {
log.Info("\tfile", filename)
if filename == "go.mod" {
log.Info("Found go.mod. does version match release version?")
log.Info(repo.lastTag.String(), "vs", repo.targetVersion.String())
if repo.lastTag.String() != repo.targetVersion.String() {
log.Info(repo.lastTag.String(), "vs", repo.targetVersion.String())
log.Info("Found go.sum. version mismatch")
setCurrentRepo(repo, "VERY BROKEN", "rewind go.mod commit")
return
}
}
if filename == "go.sum" {
log.Info("Found go.sum. does version match release version?")
log.Info(repo.lastTag.String(), "vs", repo.targetVersion.String())
if repo.lastTag.String() != repo.targetVersion.String() {
log.Info(repo.lastTag.String(), "vs", repo.targetVersion.String())
log.Info("Found go.sum. version mismatch")
setCurrentRepo(repo, "VERY BROKEN", "rewind go.mod commit")
return
}
}
}
}
log.Info("All repos seem okay")
})
group2 := vbox.NewGroup("Debugger") group2 := vbox.NewGroup("Debugger")
group2.NewButton("logging Window", func() { group2.NewButton("logging Window", func() {
logsettings.LogWindow() logsettings.LogWindow()

View File

@ -138,7 +138,7 @@ func createReleaseBox(box *gui.Node) {
var all [][]string var all [][]string
all = append(all, []string{"git", "add", "-f", "go.mod"}) all = append(all, []string{"git", "add", "-f", "go.mod"})
if release.status.String() == "PRIMATIVE" { if release.current.status.CheckPrimativeGoMod() {
// don't add go.sum here. TODO: check for go.sum file and fail // don't add go.sum here. TODO: check for go.sum file and fail
} else { } else {
all = append(all, []string{"git", "add", "-f", "go.sum"}) all = append(all, []string{"git", "add", "-f", "go.sum"})

View File

@ -117,6 +117,12 @@ func rerelease() bool {
log.Info("\treset to devel", curName, release.version.String(), me.releaseReasonS) log.Info("\treset to devel", curName, release.version.String(), me.releaseReasonS)
// git checkout devel
// git branch -D master
// git branch master
// git checkout master
// git push --set-upstream --force origin master
var all [][]string var all [][]string
all = append(all, []string{"git", "checkout", "devel"}) all = append(all, []string{"git", "checkout", "devel"})
all = append(all, []string{"git", "branch", "-D", mName}) all = append(all, []string{"git", "branch", "-D", mName})

20
unwind1.sh Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash -x
if [ "$1" == "guimaster" ]; then
git checkout devel
git branch -D guimaster
git branch guimaster
git checkout guimaster
git push --set-upstream --force origin guimaster
exit
fi
if [ "$1" == "master" ]; then
git checkout devel
git branch -D master
git branch master
git checkout master
git push --set-upstream --force origin master
exit
fi