I am automating a simple Gerrit workflow of commit, push and approve a change. Sometimes the pushes fail with an error message
[Nest] 91608 - 02/02/2024, 8:27:46 PM ERROR
Error: To ssh://git.xxxx:1234/somerepo.git
! refs/heads/CICCORNERSTONE:refs/for/CICCORNERSTONE [remote rejected] (no new changes)
Done
Pushing to ssh://git.xxxx:1234/somerepo.git
remote: Processing changes: refs: 1, done
error: failed to push some refs to 'ssh://git.xxxx:1234/somerepo.git'
The situation where I see these errors is when a commit is pushed, a CR is created and abandoned. Unfortunately for some reason beyond my control the change is pushed again, and that is when the above error is thrown.
As per the documentation mentioned at https://gerrit-review.googlesource.com/Documentation/error-no-new-changes.html
we can find the change associated with the commit id.
Could you advise me on
- How do we find the latest commit id since the above error does not show that.
- Is there an automated way (e.g. via APIs) that we can find the change number for the given commit id
Thanks, Prabal