From aea7f168911df8a91357270a0eab84c4b5ff1174 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Wed, 3 Sep 2025 19:22:49 -0500 Subject: [PATCH] dump more code cruft --- applyPatch.go | 14 ++++---------- doCommit.go | 3 +-- doConfig.go | 14 ++++++++------ doDirty.go | 14 +++----------- doGui.go | 10 ++++------ doNormal.go | 2 +- main.go | 2 +- 7 files changed, 22 insertions(+), 37 deletions(-) diff --git a/applyPatch.go b/applyPatch.go index 223a2d9..626a582 100644 --- a/applyPatch.go +++ b/applyPatch.go @@ -3,16 +3,6 @@ package main -import ( - "os" - "path/filepath" - "strings" - - "go.wit.com/lib/protobuf/forgepb" - "go.wit.com/lib/protobuf/gitpb" - "go.wit.com/log" -) - /* // saves the patches in ~/.config/forge/currentpatches/ func savePatchset(pset *forgepb.Patchset) error { @@ -45,6 +35,7 @@ func savePatchset(pset *forgepb.Patchset) error { } */ +/* // re-run git CheckDirty() on everything func IsAnythingDirty() bool { doCheckDirtyAndConfigSave() @@ -55,7 +46,9 @@ func IsAnythingDirty() bool { return true } } +*/ +/* // From 18ee541f89be2e9f9a91c54873da87885e8ffdf5 Mon Sep 17 00:00:00 2001 // From: Jeff Carr // Date: Sun, 5 Jan 2025 01:18:47 -0600 @@ -122,3 +115,4 @@ func doRegister(newurl string) error { } return nil } +*/ diff --git a/doCommit.go b/doCommit.go index ef379a2..8ec6d45 100644 --- a/doCommit.go +++ b/doCommit.go @@ -13,8 +13,7 @@ import ( func doCommit() { if argv.All { - doCheckDirtyAndConfigSave() - found := me.forge.FindDirty() + found := me.forge.CheckDirty() var newpatches bool for repo := range found.IterAll() { log.Info("do a commit on repo", repo.GetGoPath()) diff --git a/doConfig.go b/doConfig.go index ce4645d..a553f15 100644 --- a/doConfig.go +++ b/doConfig.go @@ -22,13 +22,15 @@ func doConfig() { okExit("") } - if argv.Config.Register != "" { - if err := doRegister(argv.Config.Register); err == nil { - okExit("attempting to register " + argv.Config.Register) - } else { - badExit(err) + /* + if argv.Config.Register != "" { + if err := doRegister(argv.Config.Register); err == nil { + okExit("attempting to register " + argv.Config.Register) + } else { + badExit(err) + } } - } + */ // try to add, then save config and exit if argv.Config.Add != nil { diff --git a/doDirty.go b/doDirty.go index ca25e8b..7c9f880 100644 --- a/doDirty.go +++ b/doDirty.go @@ -3,18 +3,8 @@ package main -import ( - "time" - - "go.wit.com/lib/gui/shell" - "go.wit.com/lib/protobuf/gitpb" - "go.wit.com/log" -) - func doDirty() { - doCheckDirtyAndConfigSave() - - found := me.forge.FindDirty() + found := me.forge.CheckDirty() if found.Len() == 0 { return } @@ -25,6 +15,7 @@ func doDirty() { } } +/* func straightCheckDirty() int { var count int // var total int @@ -64,3 +55,4 @@ func doCheckDirtyAndConfigSave() { me.forge.ConfigSave() } } +*/ diff --git a/doGui.go b/doGui.go index cbe2c57..f18185a 100644 --- a/doGui.go +++ b/doGui.go @@ -48,19 +48,17 @@ func debug() { me.repoWritableB.SetLabel(tmp) } - doCheckDirtyAndConfigSave() - found := me.forge.FindDirty() - dirty := found.Len() + dirty := me.forge.CheckDirty() if me.repoDirtyB != nil { - tmp := fmt.Sprintf("dirty (%d)", dirty) + tmp := fmt.Sprintf("dirty (%d)", dirty.Len()) me.repoDirtyB.SetLabel(tmp) } if me.reposWinB != nil { tmp := fmt.Sprintf("Repos (%d)", me.forge.Repos.Len()) - if dirty > 0 { - tmp = fmt.Sprintf("Repos (%d) (%d dirty)", me.forge.Repos.Len(), dirty) + if dirty.Len() > 0 { + tmp = fmt.Sprintf("Repos (%d) (%d dirty)", me.forge.Repos.Len(), dirty.Len()) } me.reposWinB.SetLabel(tmp) } diff --git a/doNormal.go b/doNormal.go index edf1699..dc9588f 100644 --- a/doNormal.go +++ b/doNormal.go @@ -13,7 +13,7 @@ import ( ) func doNormal() bool { - doCheckDirtyAndConfigSave() + me.forge.CheckDirty() var count int stats := me.forge.RillRepos(checkNormalRepoState) diff --git a/main.go b/main.go index 8958545..c5ecf39 100644 --- a/main.go +++ b/main.go @@ -213,7 +213,7 @@ func main() { // basically, if you run just 'forge' it should open the GUI // if opening the GUI, always check git for dirty repos - doCheckDirtyAndConfigSave() + me.forge.CheckDirty() doGui() okExit("") }