summaryrefslogtreecommitdiff
path: root/doClean.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-25 22:44:43 -0500
committerJeff Carr <[email protected]>2025-09-25 22:44:43 -0500
commit174289d3db0e5ddf365159d39cfbed45ef832118 (patch)
tree1218d7e6fcaf268e0b185ecf046f83c08f9e1ad4 /doClean.go
parentfc9b0a69a8dff400c04758d07988b7a7f3f17838 (diff)
dump out PatchId infov0.25.33
Diffstat (limited to 'doClean.go')
-rw-r--r--doClean.go33
1 files 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
}