check to make sure everything is on the devel branch

This commit is contained in:
Jeff Carr 2025-01-05 05:48:02 -06:00
parent 79ec3ce469
commit 2c7e15ccfa
5 changed files with 29 additions and 4 deletions

10
README.md Normal file
View File

@ -0,0 +1,10 @@
forge
expiremental work on federated git
/usr/share/git-gui/lib/tools/
.git/config settings for gitgui
[gui]
wmstate = normal
geometry = 931x515+450+130 197 234

View File

@ -62,7 +62,7 @@ func IsValidPatch(p *forgepb.Patch) bool {
func IsAnythingDirty() bool {
me.found = new(gitpb.Repos)
findAll() // select all the repos
doCheckDirty()
doCheckDirtyAndConfigSave()
me.found = new(gitpb.Repos)
findDirty()
if len(me.found.Repos) == 0 {

View File

@ -33,7 +33,7 @@ func doGitPull() {
}
func doCheckDirty() {
func doCheckDirtyAndConfigSave() {
now := time.Now()
all := me.found.SortByFullPath()
for all.Scan() {
@ -50,11 +50,22 @@ func doCheckDirty() {
}
}
}
// doCobol()
log.Info("dirty check took:", shell.FormatDuration(time.Since(now)))
me.forge.SetConfigSave(configSave)
}
func IsEverythingOnDevel() bool {
all := me.forge.Repos.SortByFullPath()
for all.Scan() {
repo := all.Next()
if repo.GetCurrentBranchName() != repo.GetDevelBranchName() {
log.Info(repo.GetFullPath(), repo.GetCurrentBranchName(), repo.GetDevelBranchName())
return false
}
}
return true
}
func doGitReset() {
all := me.found.SortByFullPath()
for all.Scan() {

View File

@ -110,7 +110,7 @@ func main() {
var done bool = false
if argv.Dirty != nil {
findAll() // select all the repos
doCheckDirty()
doCheckDirtyAndConfigSave()
me.found = new(gitpb.Repos)
findDirty()
doCobol()

View File

@ -192,6 +192,10 @@ func submitPatchesBox(box *gui.Node) *patchSummary {
if err != nil {
return
}
if !IsEverythingOnDevel() {
log.Info("You can only apply patches to the devel branch")
return
}
if IsAnythingDirty() {
log.Info("You can't apply patches when repos are dirty")
doCobol()