dump more code cruft

This commit is contained in:
Jeff Carr 2025-09-03 19:22:49 -05:00
parent 6f4ec05ccb
commit aea7f16891
7 changed files with 22 additions and 37 deletions

View File

@ -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 <jcarr@wit.com>
// Date: Sun, 5 Jan 2025 01:18:47 -0600
@ -122,3 +115,4 @@ func doRegister(newurl string) error {
}
return nil
}
*/

View File

@ -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())

View File

@ -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 {

View File

@ -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()
}
}
*/

View File

@ -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)
}

View File

@ -13,7 +13,7 @@ import (
)
func doNormal() bool {
doCheckDirtyAndConfigSave()
me.forge.CheckDirty()
var count int
stats := me.forge.RillRepos(checkNormalRepoState)

View File

@ -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("")
}