From 174289d3db0e5ddf365159d39cfbed45ef832118 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 25 Sep 2025 22:44:43 -0500 Subject: [PATCH] dump out PatchId info --- doClean.go | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/doClean.go b/doClean.go index 29154a0..8e6e024 100644 --- a/doClean.go +++ b/doClean.go @@ -272,10 +272,39 @@ func checkRemoteBranches(repo *gitpb.Repo) error { } func checkPatchIds(repo *gitpb.Repo, b1 string, b2 string) error { + ids := make(map[string]string) s1 := fmt.Sprintf("%s..%s", b1, b2) s2 := fmt.Sprintf("%s..%s", b2, b1) - repo.RunVerbose([]string{"git", "rev-list", s1}) - repo.RunVerbose([]string{"git", "rev-list", s2}) + if stats, err := repo.RunStrict([]string{"git", "rev-list", s1}); err != nil { + return err + } else { + for _, hash := range stats.Stdout { + patchId, err := repo.FindPatchId(hash) + if err != nil { + continue + } + ids[patchId] = hash + } + } + + if stats, err := repo.RunStrict([]string{"git", "rev-list", s2}); err != nil { + return err + } else { + for _, hash := range stats.Stdout { + patchId, err := repo.FindPatchId(hash) + if err != nil { + continue + } + if _, ok := ids[patchId]; ok { + log.Info("already here") + } else { + ids[patchId] = hash + } + } + } + for key, val := range ids { + log.Info(key, val) + } return nil }