summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-07-21 22:24:59 -0500
committerJeff Carr <[email protected]>2025-07-21 22:24:59 -0500
commita21d17dda963eec946ca5f2e40d2a8a9aee9e009 (patch)
tree3ff85fa9fc77308e54e4b1cafca09d008d1b6d65
parent5b5d262ce446037c52c661bf5383c6266b0cbe3b (diff)
check for "normal" repo states
-rw-r--r--doDirty.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/doDirty.go b/doDirty.go
index 49acbfe..75deccd 100644
--- a/doDirty.go
+++ b/doDirty.go
@@ -13,6 +13,12 @@ import (
func doDirty() {
doCheckDirtyAndConfigSave()
+ if allerr := me.forge.RillRepos(checkNormalRepoState); len(allerr) != 0 {
+ log.Info("Some repos are not in a 'normal' state. error count =", len(allerr))
+ for repo, err := range allerr {
+ log.Info("repo not normal", repo.GetFullPath(), err)
+ }
+ }
found := findDirty()
if argv.Verbose {
me.forge.PrintHumanTableDirty(found)
@@ -21,6 +27,21 @@ func doDirty() {
}
}
+// 99% of the time, the repos during development should be on your user branch.
+// error out if it's not
+// this checks to see if a devel and user branch exist
+// this needs to run each time in case repos were added manually by the user
+// this also verifies that
+func checkNormalRepoState(repo *gitpb.Repo) error {
+ if err := repo.MakeLocalDevelBranch(); err != nil {
+ return err
+ }
+ if repo.GetCurrentBranchName() != repo.GetUserBranchName() {
+ return repo.CheckoutUser()
+ }
+ return nil
+}
+
func straightCheckDirty() int {
var count int
// var total int
@@ -45,6 +66,7 @@ func doCheckDirty(repo *gitpb.Repo) error {
return nil
}
+// recheck every repo's dirty state according to 'git'
func doCheckDirtyAndConfigSave() {
start := straightCheckDirty()