dump more code cruft
This commit is contained in:
parent
6f4ec05ccb
commit
aea7f16891
|
@ -3,16 +3,6 @@
|
||||||
|
|
||||||
package main
|
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/
|
// saves the patches in ~/.config/forge/currentpatches/
|
||||||
func savePatchset(pset *forgepb.Patchset) error {
|
func savePatchset(pset *forgepb.Patchset) error {
|
||||||
|
@ -45,6 +35,7 @@ func savePatchset(pset *forgepb.Patchset) error {
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
// re-run git CheckDirty() on everything
|
// re-run git CheckDirty() on everything
|
||||||
func IsAnythingDirty() bool {
|
func IsAnythingDirty() bool {
|
||||||
doCheckDirtyAndConfigSave()
|
doCheckDirtyAndConfigSave()
|
||||||
|
@ -55,7 +46,9 @@ func IsAnythingDirty() bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
// From 18ee541f89be2e9f9a91c54873da87885e8ffdf5 Mon Sep 17 00:00:00 2001
|
// From 18ee541f89be2e9f9a91c54873da87885e8ffdf5 Mon Sep 17 00:00:00 2001
|
||||||
// From: Jeff Carr <jcarr@wit.com>
|
// From: Jeff Carr <jcarr@wit.com>
|
||||||
// Date: Sun, 5 Jan 2025 01:18:47 -0600
|
// Date: Sun, 5 Jan 2025 01:18:47 -0600
|
||||||
|
@ -122,3 +115,4 @@ func doRegister(newurl string) error {
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
|
@ -13,8 +13,7 @@ import (
|
||||||
|
|
||||||
func doCommit() {
|
func doCommit() {
|
||||||
if argv.All {
|
if argv.All {
|
||||||
doCheckDirtyAndConfigSave()
|
found := me.forge.CheckDirty()
|
||||||
found := me.forge.FindDirty()
|
|
||||||
var newpatches bool
|
var newpatches bool
|
||||||
for repo := range found.IterAll() {
|
for repo := range found.IterAll() {
|
||||||
log.Info("do a commit on repo", repo.GetGoPath())
|
log.Info("do a commit on repo", repo.GetGoPath())
|
||||||
|
|
14
doConfig.go
14
doConfig.go
|
@ -22,13 +22,15 @@ func doConfig() {
|
||||||
okExit("")
|
okExit("")
|
||||||
}
|
}
|
||||||
|
|
||||||
if argv.Config.Register != "" {
|
/*
|
||||||
if err := doRegister(argv.Config.Register); err == nil {
|
if argv.Config.Register != "" {
|
||||||
okExit("attempting to register " + argv.Config.Register)
|
if err := doRegister(argv.Config.Register); err == nil {
|
||||||
} else {
|
okExit("attempting to register " + argv.Config.Register)
|
||||||
badExit(err)
|
} else {
|
||||||
|
badExit(err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
*/
|
||||||
|
|
||||||
// try to add, then save config and exit
|
// try to add, then save config and exit
|
||||||
if argv.Config.Add != nil {
|
if argv.Config.Add != nil {
|
||||||
|
|
14
doDirty.go
14
doDirty.go
|
@ -3,18 +3,8 @@
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
|
||||||
"time"
|
|
||||||
|
|
||||||
"go.wit.com/lib/gui/shell"
|
|
||||||
"go.wit.com/lib/protobuf/gitpb"
|
|
||||||
"go.wit.com/log"
|
|
||||||
)
|
|
||||||
|
|
||||||
func doDirty() {
|
func doDirty() {
|
||||||
doCheckDirtyAndConfigSave()
|
found := me.forge.CheckDirty()
|
||||||
|
|
||||||
found := me.forge.FindDirty()
|
|
||||||
if found.Len() == 0 {
|
if found.Len() == 0 {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -25,6 +15,7 @@ func doDirty() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
func straightCheckDirty() int {
|
func straightCheckDirty() int {
|
||||||
var count int
|
var count int
|
||||||
// var total int
|
// var total int
|
||||||
|
@ -64,3 +55,4 @@ func doCheckDirtyAndConfigSave() {
|
||||||
me.forge.ConfigSave()
|
me.forge.ConfigSave()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
10
doGui.go
10
doGui.go
|
@ -48,19 +48,17 @@ func debug() {
|
||||||
me.repoWritableB.SetLabel(tmp)
|
me.repoWritableB.SetLabel(tmp)
|
||||||
}
|
}
|
||||||
|
|
||||||
doCheckDirtyAndConfigSave()
|
dirty := me.forge.CheckDirty()
|
||||||
found := me.forge.FindDirty()
|
|
||||||
dirty := found.Len()
|
|
||||||
|
|
||||||
if me.repoDirtyB != nil {
|
if me.repoDirtyB != nil {
|
||||||
tmp := fmt.Sprintf("dirty (%d)", dirty)
|
tmp := fmt.Sprintf("dirty (%d)", dirty.Len())
|
||||||
me.repoDirtyB.SetLabel(tmp)
|
me.repoDirtyB.SetLabel(tmp)
|
||||||
}
|
}
|
||||||
|
|
||||||
if me.reposWinB != nil {
|
if me.reposWinB != nil {
|
||||||
tmp := fmt.Sprintf("Repos (%d)", me.forge.Repos.Len())
|
tmp := fmt.Sprintf("Repos (%d)", me.forge.Repos.Len())
|
||||||
if dirty > 0 {
|
if dirty.Len() > 0 {
|
||||||
tmp = fmt.Sprintf("Repos (%d) (%d dirty)", me.forge.Repos.Len(), dirty)
|
tmp = fmt.Sprintf("Repos (%d) (%d dirty)", me.forge.Repos.Len(), dirty.Len())
|
||||||
}
|
}
|
||||||
me.reposWinB.SetLabel(tmp)
|
me.reposWinB.SetLabel(tmp)
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func doNormal() bool {
|
func doNormal() bool {
|
||||||
doCheckDirtyAndConfigSave()
|
me.forge.CheckDirty()
|
||||||
|
|
||||||
var count int
|
var count int
|
||||||
stats := me.forge.RillRepos(checkNormalRepoState)
|
stats := me.forge.RillRepos(checkNormalRepoState)
|
||||||
|
|
2
main.go
2
main.go
|
@ -213,7 +213,7 @@ func main() {
|
||||||
// basically, if you run just 'forge' it should open the GUI
|
// basically, if you run just 'forge' it should open the GUI
|
||||||
|
|
||||||
// if opening the GUI, always check git for dirty repos
|
// if opening the GUI, always check git for dirty repos
|
||||||
doCheckDirtyAndConfigSave()
|
me.forge.CheckDirty()
|
||||||
doGui()
|
doGui()
|
||||||
okExit("")
|
okExit("")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue