summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-01-19 02:56:48 -0600
committerJeff Carr <[email protected]>2025-01-19 02:56:48 -0600
commit69eee080459392cef8382a9376aa22692e9ca830 (patch)
tree48e030f7da1cc10797936c5eaec370c613c4dcb4
parent6b2a61ff0e95115a35031047efc0a540b72bcd9c (diff)
git branch handling continues
-rw-r--r--doClean.go21
-rw-r--r--doGui.go12
-rw-r--r--windowRepos.go9
3 files changed, 33 insertions, 9 deletions
diff --git a/doClean.go b/doClean.go
index cfe5b19..0717ad6 100644
--- a/doClean.go
+++ b/doClean.go
@@ -56,17 +56,21 @@ func doCleanRepo(repo *gitpb.Repo) error {
// todo: make sure the master branch is in sync with remote master
continue
}
- hasLocal = true
if name == repo.GetUserBranchName() {
+ hasLocal = true
if err := doCleanUserBranch(repo, b); err != nil {
+ log.Info("\tLOCAL BRANCH ERROR user")
return err
}
+ log.Info("\tLOCAL BRANCH user")
continue
}
if name == repo.GetDevelBranchName() {
if err := doCleanDevelBranch(repo, b); err != nil {
+ log.Info("\tLOCAL BRANCH ERROR devel")
return err
}
+ log.Info("\tLOCAL BRANCH devel")
continue
}
log.Info("\tlocal branch name unknown:", name, b.Merge, b.Remote)
@@ -120,6 +124,18 @@ func doCleanUserBranch(repo *gitpb.Repo, branch *gitpb.GitBranch) error {
repo.RunVerbose([]string{"ls", "-l", ".git/refs/remotes/origin"})
repo.RunVerbose([]string{"cat", filepath.Join(".git/refs/remotes/origin", branch.Name)})
repo.RunVerbose([]string{"cat", filepath.Join(".git/refs/heads", branch.Name)})
+ if err := userToDevelRequiresGitPush(repo, branch.Name); err != nil {
+ log.Info(err)
+ log.Info("THIS USER BRANCH MUST BE PUSHED TO DEVEL", branch.Name)
+ return err
+ }
+ log.Info("THIS USER BRANCH IS CLEAN TO DELETE", branch.Name)
+ if argv.Clean.Force != nil {
+ cmd := []string{"git", "branch", "-D", branch.Name}
+ _, err := repo.RunVerbose(cmd)
+ log.Info(err)
+ return err
+ }
} else {
log.Info("why is this local only branch a problem?", branch.Name)
repo.RunVerbose([]string{"ls", "-l", ".git/refs/remotes/origin"})
@@ -130,12 +146,15 @@ func doCleanUserBranch(repo *gitpb.Repo, branch *gitpb.GitBranch) error {
log.Info(cmd)
}
if err := userToDevelRequiresGitPush(repo, branch.Name); err != nil {
+ log.Info(err)
+ log.Info("THIS USER BRANCH MUST BE PUSHED TO DEVEL", branch.Name)
return err
}
log.Info("THIS USER BRANCH IS CLEAN TO DELETE", branch.Name)
if argv.Clean.Force != nil {
cmd := []string{"git", "branch", "-D", branch.Name}
_, err := repo.RunVerbose(cmd)
+ log.Info(err)
return err
}
}
diff --git a/doGui.go b/doGui.go
index f84f019..039c374 100644
--- a/doGui.go
+++ b/doGui.go
@@ -3,6 +3,8 @@ package main
// An app to submit patches for the 30 GO GUI repos
import (
+ "os"
+
"go.wit.com/gui"
"go.wit.com/lib/debugger"
"go.wit.com/lib/gadgets"
@@ -30,6 +32,16 @@ func doGui() {
me.mainWindow = gadgets.RawBasicWindow("Forge: (this doesn't work yet)")
me.mainWindow.Make()
me.mainWindow.Show()
+ me.mainWindow.Custom = func() {
+ log.Warn("MAIN WINDOW CLOSE")
+ count := me.forge.RillReload()
+ log.Info("Repo Reload count =", count)
+ if count != 0 {
+ me.forge.ConfigSave()
+ }
+ os.Exit(0)
+ }
+
me.mainbox = me.mainWindow.Box()
// disable the interface while everything is scanned
diff --git a/windowRepos.go b/windowRepos.go
index 03a8fef..c99116e 100644
--- a/windowRepos.go
+++ b/windowRepos.go
@@ -54,14 +54,7 @@ func makeRepoView() *repoWindow {
r.box = r.win.Box().NewBox("bw vbox", false)
// me.reposwin.Draw()
r.win.Custom = func() {
- log.Warn("GOT HERE: main() gadgets.NewBasicWindow() close")
- log.Warn("Should I do something special here?")
- count := me.forge.RillReload()
- log.Info("Repo Reload count =", count)
- if count != 0 {
- me.forge.ConfigSave()
- }
- os.Exit(0)
+ log.Warn("Repo Window close. Do something here?")
}
r.topbox = r.repoMenu()