Continue the work in #5456 to make the cherry-pick script more debuggable. You'll want to: 1. Reuse the changes made in #5456. 2. Update the script to address the open comments.