From e09849b1a21349f1ac5eaa8d61547a38815c28c6 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 4 Sep 2025 22:37:55 -0500 Subject: [PATCH] try to report old patches --- doPatch.go | 1 + helperPatches.go | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/doPatch.go b/doPatch.go index 06d1e85..ee70400 100644 --- a/doPatch.go +++ b/doPatch.go @@ -37,6 +37,7 @@ func doPatch() error { for p := range old.IterAll() { log.Info("patch", p.Filename, p.Namespace) } + me.forge.SubmitPatchesNew(old, "oldpatchset") return nil } diff --git a/helperPatches.go b/helperPatches.go index 8cf5cd9..9280adb 100644 --- a/helperPatches.go +++ b/helperPatches.go @@ -266,20 +266,22 @@ func findExpired() *forgepb.Patches { continue } os.Chdir(repo.GetFullPath()) - newhash, err := findCommitByHash(patch.StartHash, comment) - if err != nil { - // this patch has not been applied yet - log.Info("patch: not found hash:", patch.Namespace, patch.CommitHash, comment, err) - continue - } - - newhash, err = findCommitBySubject(comment) + _, err := findCommitByHash(patch.StartHash, comment) if err == nil { - patch.NewHash = newhash - log.Info("patch: found hash:", patch.Namespace, "commit patch", patch.CommitHash, "new hash", newhash, "start hash", patch.StartHash, comment) + log.Info("found applied patch", patch.Namespace, ": newhash:", patch.NewHash, "commithash:", patch.CommitHash, comment) found.AppendByCommitHash(patch) // double check to ensure the commit hash isn't added twice continue } + /* + + newhash, err = findCommitBySubject(comment) + if err == nil { + patch.NewHash = newhash + log.Info("patch: found hash:", patch.Namespace, "commit patch", patch.CommitHash, "new hash", newhash, "start hash", patch.StartHash, comment) + found.AppendByCommitHash(patch) // double check to ensure the commit hash isn't added twice + continue + } + */ } return found