diff options
| author | Jeff Carr <[email protected]> | 2025-09-06 19:21:00 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-09-06 19:21:00 -0500 |
| commit | d99eb81385a293ccf9bf8f6e902a3a7798bf36a2 (patch) | |
| tree | 7b6b068a04e2e2d5917abdde16658d3f0714856d | |
| parent | 1087b39f9ccedd3042f2f8d884b281b535cbb93c (diff) | |
start checking the "normal" state every time
| -rw-r--r-- | doNormal.go | 1 | ||||
| -rw-r--r-- | doPatch.go | 10 | ||||
| -rw-r--r-- | main.go | 15 |
3 files changed, 25 insertions, 1 deletions
diff --git a/doNormal.go b/doNormal.go index 08044ee..12b0eaf 100644 --- a/doNormal.go +++ b/doNormal.go @@ -62,6 +62,7 @@ func checkNormalRepoState(repo *gitpb.Repo) error { if repo.GetCurrentBranchName() != repo.GetUserBranchName() { configSave = true + log.Info("crapnuts") repo.CheckoutUser() repo.Reload() return log.Errorf("now on user branch") @@ -12,7 +12,11 @@ import ( func doPatchInit() { if me.forge.Patchsets != nil { - log.Info("IGNORE: patches already initalized") + if me.forge.Patchsets.Len() == 0 { + // log.Info("IGNORE: patches are empty") + } else { + log.Info("IGNORE: patches already initalized len =", me.forge.Patchsets.Len()) + } } if err := me.forge.LoadPatchsets(); err != nil { log.Info("patches failed to open", err) @@ -82,6 +86,10 @@ func doPatch() error { me.forge.Patchsets.PrintTable() // return doPatchList() applied := findApplied() + if applied.Len() == 0 { + log.Info("no patches have to appled to the devel branch yet") + return nil + } // for patch := range applied.IterAll() { // log.Info("SEND APPLIED: newhash:", patch.NewHash, "commithash:", patch.CommitHash, "patch", patch.Namespace) // } @@ -99,6 +99,7 @@ func main() { } if argv.Checkout != nil { + me.forge.Config.Mode = forgepb.ForgeMode_MASTER if err := doCheckout(); err != nil { badExit(err) } @@ -120,6 +121,7 @@ func main() { } if argv.Clean != nil { + me.forge.Config.Mode = forgepb.ForgeMode_CLEAN if argv.Clean.Repo != "" { log.Info("only looking at repo:", argv.Clean.Repo) okExit("") @@ -140,11 +142,24 @@ func main() { if argv.Normal != nil { if doNormal() { log.Infof("all %d repos are on your user branch. It is safe to write code now.\n", me.forge.Repos.Len()) + if me.forge.Config.Mode != forgepb.ForgeMode_NORMAL { + log.Infof("Forge has set the mode to 'Normal'\n") + me.forge.Config.Mode = forgepb.ForgeMode_NORMAL + me.forge.ConfigSave() + } okExit("") } okExit("") } + // if you are in "normal" mode, always run normal every time to catch accidental errors + // for example, if you accidentally changed branches from your user branch + if me.forge.Config.Mode == forgepb.ForgeMode_NORMAL { + if doNormal() { + log.Infof("all %d repos are still normal\n", me.forge.Repos.Len()) + } + } + if argv.Dirty != nil { doDirty() okExit("") |
