wow, even a name change is a BAD IDEA. NEVER DO IT

This commit is contained in:
Jeff Carr 2025-01-07 21:23:21 -06:00
parent f21c471032
commit 3298e02c2a
3 changed files with 42 additions and 2 deletions

View File

@ -19,6 +19,8 @@ func (repo *Repo) Reload() error {
repo.ParseGoSum() // also sets GoPrimitive repo.ParseGoSum() // also sets GoPrimitive
repo.reloadVersions() repo.reloadVersions()
repo.setRepoType() repo.setRepoType()
repo.CheckDirty()
repo.setRepoState()
// everything has been checked, now save the mtime's // everything has been checked, now save the mtime's
repo.updateMtimes() repo.updateMtimes()

38
reloadRepoState.go Normal file
View File

@ -0,0 +1,38 @@
package gitpb
// does processing on the go.mod and go.sum files
import (
"go.wit.com/log"
)
func (repo *Repo) setRepoState() {
if repo == nil {
return
}
if repo.IsDirty() {
repo.State = "dirty"
return
}
if repo.GetUserVersion() != repo.GetDevelVersion() {
repo.State = "merge to devel"
return
}
if repo.GetDevelVersion() != repo.GetMasterVersion() {
repo.State = "merge to main"
return
}
if repo.GetLastTag() != repo.GetMasterVersion() {
repo.State = "unchanged"
return
}
if repo.CheckBranches() {
repo.State = "PERFECT"
return
}
log.Info("Branches are not Perfect", repo.GetFullPath())
log.Info("Branches are not Perfect", repo.GetFullPath())
log.Info("Branches are not Perfect", repo.GetFullPath())
repo.State = "unknown branches"
}

View File

@ -28,12 +28,12 @@ message Repo { // `autogenpb:marshal`
string targetVersion = 15; // useful during the package release process string targetVersion = 15; // useful during the package release process
bool readOnly = 16; // tracks access to 'git push' bool readOnly = 16; // tracks access to 'git push'
string desc = 17; // what is this repo? string desc = 17; // what is this repo?
string state = 18; // status or state. useful for building tooling string stateChange = 18; // used for debugging tool logic
string masterVersion = 19; // just store this for now string masterVersion = 19; // just store this for now
string develVersion = 20; // string develVersion = 20; //
string userVersion = 21; // string userVersion = 21; //
repeated string dirtyList = 22; // store the list from git status --porcelain repeated string dirtyList = 22; // store the list from git status --porcelain
string stateChange = 23; // used for debugging tool logic string state = 23; // status or state. useful for building tooling
} }
message Repos { // `autogenpb:marshal` message Repos { // `autogenpb:marshal`