I'm trying to get all the commit hashes that are coming in from a merge. My ultimate goal is to grab the emails of these commiters and email them if the merge breaks a build. However, I'm not sure how to approach this problem. This needs to be done entirely in the terminal because it will be automated by Jenkins.
One approach I've tried is possibly finding the commits between the merge commit and the last commit added to master. However, apparently these seem to be meshed by timestamps.
Another approach I've thought of is finding the branch that was merged into master, and just get all the hashes there. However, I don't know a command that does this.
I'm using this at the moment to find the merge commit hash (and email)
git log -1 --merges -pretty=format:%H
git log -1 --merges -pretty=format%ae
The expected result is that I should get the hashes of all the commits and being able to find the email addresses of these commiters.