dump out PatchId info

This commit is contained in:
Jeff Carr 2025-09-25 22:44:43 -05:00
parent fc9b0a69a8
commit 174289d3db
1 changed files with 31 additions and 2 deletions

View File

@ -272,10 +272,39 @@ func checkRemoteBranches(repo *gitpb.Repo) error {
} }
func checkPatchIds(repo *gitpb.Repo, b1 string, b2 string) error { func checkPatchIds(repo *gitpb.Repo, b1 string, b2 string) error {
ids := make(map[string]string)
s1 := fmt.Sprintf("%s..%s", b1, b2) s1 := fmt.Sprintf("%s..%s", b1, b2)
s2 := fmt.Sprintf("%s..%s", b2, b1) s2 := fmt.Sprintf("%s..%s", b2, b1)
repo.RunVerbose([]string{"git", "rev-list", s1}) if stats, err := repo.RunStrict([]string{"git", "rev-list", s1}); err != nil {
repo.RunVerbose([]string{"git", "rev-list", s2}) 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 return nil
} }