summaryrefslogtreecommitdiff
path: root/helperPatches.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-06 17:14:46 -0500
committerJeff Carr <[email protected]>2025-09-06 17:14:46 -0500
commit1087b39f9ccedd3042f2f8d884b281b535cbb93c (patch)
treeaaa6294b09a8bdf6a9354d22789f44167b844e1d /helperPatches.go
parent893c88bbf5d6aea99b7b6dfd28b590a3d65b1eeb (diff)
start reporting applied patchesv0.22.144
Diffstat (limited to 'helperPatches.go')
-rw-r--r--helperPatches.go31
1 files changed, 31 insertions, 0 deletions
diff --git a/helperPatches.go b/helperPatches.go
index 2d2d90c..d6e07d7 100644
--- a/helperPatches.go
+++ b/helperPatches.go
@@ -309,3 +309,34 @@ func findExpired() *forgepb.Patches {
return found
}
+
+func findApplied() *forgepb.Patches {
+ var pset *forgepb.Patches
+ for found := range me.forge.Patchsets.IterAll() {
+ if found.Name == "forge auto commit" {
+ pset = found.Patches
+ }
+ }
+
+ if pset == nil {
+ log.Info("failed to find 'forge auto commit'")
+ return pset
+ }
+
+ found := forgepb.NewPatches()
+
+ for patch := range pset.IterAll() {
+ cmd := []string{"git", "merge-base", "--is-ancestor", patch.CommitHash, "devel"}
+ repo := me.forge.Repos.FindByNamespace(patch.Namespace)
+ _, err := repo.RunStrict(cmd)
+ if err != nil {
+ // log.Info("NOT APPLIED", patch.Namespace, result, err)
+ // log.Info("NOT APPLIED newhash:", patch.NewHash, "commithash:", patch.CommitHash, "patch", patch.Namespace)
+ } else {
+ // log.Info("APPLIED newhash:", patch.NewHash, "commithash:", patch.CommitHash, "patch", patch.Namespace)
+ found.Append(patch)
+ }
+ }
+
+ return found
+}