more general work for patches

This commit is contained in:
Jeff Carr 2025-09-07 22:49:23 -05:00
parent ca3a70d623
commit b71471c61e
3 changed files with 33 additions and 13 deletions

View File

@ -4,10 +4,27 @@
package main
import (
"go.wit.com/lib/protobuf/forgepb"
"go.wit.com/lib/protobuf/gitpb"
"go.wit.com/log"
)
func doMergeReport() *forgepb.Patches {
found := forgepb.NewPatches()
for repo := range me.forge.Repos.IterAll() {
if repo.GetDevelVersion() == repo.GetMasterVersion() {
continue
}
tmp := log.Sprintf("%s..%s", repo.GetMasterVersion(), repo.GetDevelVersion())
r, err := repo.RunStrict([]string{"git", "log", "--pretty=format:%H", tmp})
_ = err
for i, line := range r.Stdout {
log.Info(i, line, repo.FullPath)
}
}
return found
}
func doMergeDevel() (*gitpb.Repos, error) {
var err error
done := gitpb.NewRepos()
@ -37,7 +54,6 @@ func doMergeDevel() (*gitpb.Repos, error) {
}
done.Append(repo)
}
configSave = true
return done, err
}

View File

@ -63,6 +63,7 @@ func doPatch() error {
}
if argv.Patch.Check != nil {
/*
old := findExpired()
// old.PrintTable()
for p := range old.IterAll() {
@ -73,6 +74,9 @@ func doPatch() error {
return err
}
newpb.PrintTable()
*/
log.Info("do something here to find patches merged to devel")
doMergeReport()
return nil
}
@ -126,7 +130,7 @@ func doPatch() error {
// return doPatchList()
applied := findApplied()
if applied.Len() == 0 {
log.Info("no patches have to appled to the devel branch yet")
log.Info("no patches have been appled to the devel branch yet")
return nil
}
// for patch := range applied.IterAll() {

View File

@ -326,7 +326,7 @@ func findApplied() *forgepb.Patches {
found := forgepb.NewPatches()
for patch := range pset.IterAll() {
cmd := []string{"git", "merge-base", "--is-ancestor", patch.CommitHash, "devel"}
cmd := []string{"git", "merge-base", "--is-ancestor", patch.NewHash, "devel"}
repo := me.forge.Repos.FindByNamespace(patch.Namespace)
_, err := repo.RunStrict(cmd)
if err != nil {